]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/link.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: macros to force linking modules which might otherwise be
4 // discarded by the linker
5 // Author: Vaclav Slavik
7 // Copyright: (c) Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
14 // This must be part of the module you want to force:
15 #define wxFORCE_LINK_THIS_MODULE(module_name) \
16 extern void _wx_link_dummy_func_##module_name (); \
17 void _wx_link_dummy_func_##module_name () { }
20 // And this must be somewhere where it certainly will be linked:
21 #define wxFORCE_LINK_MODULE(module_name) \
22 extern void _wx_link_dummy_func_##module_name (); \
23 static struct wxForceLink##module_name \
25 wxForceLink##module_name() \
27 _wx_link_dummy_func_##module_name (); \
29 } _wx_link_dummy_var_##module_name;