1999-07-07 18:04:58 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-10-02 14:19:46 -04:00
|
|
|
// Name: forcelnk.h
|
2009-01-11 06:46:45 -05:00
|
|
|
// Purpose: macros which force the linker to link apparently unused code
|
1999-07-07 18:04:58 -04:00
|
|
|
// Author: Vaclav Slavik
|
1999-10-02 14:19:46 -04:00
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Vaclav Slavik
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-07 18:04:58 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
DESCRPITON:
|
|
|
|
|
|
|
|
mod_*.cpp files contain handlers for tags. These files are modules - they contain
|
|
|
|
one wxTagModule class and it's OnInit() method is called from wxApp's init method.
|
|
|
|
The module is called even if you only link it into the executable, so everything
|
|
|
|
seems wonderful.
|
|
|
|
|
|
|
|
The problem is that we have these modules in LIBRARY and mod_*.cpp files contain
|
|
|
|
no method nor class which is known out of the module. So the linker won't
|
|
|
|
link these .o/.obj files into executable because it detected that it is not used
|
|
|
|
by the program.
|
|
|
|
|
|
|
|
To workaround this I introduced set of macros FORCE_LINK_ME and FORCE_LINK. These
|
|
|
|
macros are generic and are not limited to mod_*.cpp files. You may find them quite
|
|
|
|
useful somewhere else...
|
|
|
|
|
|
|
|
How to use them:
|
|
|
|
let's suppose you want to always link file foo.cpp and that you have module
|
|
|
|
always.cpp that is certainly always linked (e.g. the one with main() function
|
|
|
|
or htmlwin.cpp in wxHtml library).
|
|
|
|
|
|
|
|
Place FORCE_LINK_ME(foo) somewhere in foo.cpp and FORCE_LINK(foo) somewhere
|
|
|
|
in always.cpp
|
|
|
|
See mod_*.cpp and htmlwin.cpp for example :-)
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
1999-10-02 14:19:46 -04:00
|
|
|
#ifndef _WX_FORCELNK_H_
|
|
|
|
#define _WX_FORCELNK_H_
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2005-09-25 14:46:14 -04:00
|
|
|
#include "wx/link.h"
|
|
|
|
|
2005-09-25 14:09:26 -04:00
|
|
|
// compatibility defines
|
|
|
|
#define FORCE_LINK wxFORCE_LINK_MODULE
|
|
|
|
#define FORCE_LINK_ME wxFORCE_LINK_THIS_MODULE
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2001-09-19 18:44:17 -04:00
|
|
|
#define FORCE_WXHTML_MODULES() \
|
|
|
|
FORCE_LINK(m_layout) \
|
|
|
|
FORCE_LINK(m_fonts) \
|
|
|
|
FORCE_LINK(m_image) \
|
|
|
|
FORCE_LINK(m_list) \
|
|
|
|
FORCE_LINK(m_dflist) \
|
|
|
|
FORCE_LINK(m_pre) \
|
|
|
|
FORCE_LINK(m_hline) \
|
|
|
|
FORCE_LINK(m_links) \
|
|
|
|
FORCE_LINK(m_tables) \
|
2010-05-30 19:12:25 -04:00
|
|
|
FORCE_LINK(m_span) \
|
2002-01-24 16:13:38 -05:00
|
|
|
FORCE_LINK(m_style)
|
2001-09-19 18:44:17 -04:00
|
|
|
|
1999-07-07 18:04:58 -04:00
|
|
|
|
1999-10-02 14:19:46 -04:00
|
|
|
#endif // _WX_FORCELNK_H_
|