Fix several warnings that appear in gcc 4.3.2.
[wvstreams.git] / include / wvlinkerhack.h
blobfbab1da1ef8050438b93918e3864228c76a2eca6
1 #ifndef __WVLINKERHACK_H
2 #define __WVLINKERHACK_H
4 /*
5 * Don't call this directly. It's used by WV_LINK_TO().
6 */
7 extern int **__wv_link_func(int **to);
9 /**
10 * Create a target that WV_LINK_TO can point at when it wants to make sure
11 * your object file is linked into the final binary.
13 * Do not put the name in quotes.
15 * Example (in uniinigen.cc): WV_LINK(UniIniGen);
17 #define WV_LINK(name) volatile int __wv_link_##name
19 /**
20 * Link to a target created by WV_LINK, ensuring that the file which created
21 * the WV_LINK is included in your final binary. This is useful for ensuring
22 * particular monikers will always be available when you link statically,
23 * even though you don't refer to any particular classes implementing that
24 * moniker directly.
26 * Do not put the name in quotes.
28 * Example (somewhere other than uniinigen.cc): WV_LINK_TO(UniIniGen);
30 #define WV_LINK_TO(name) \
31 extern volatile int __wv_link_##name; \
32 namespace { volatile int __wv_local_a_##name = __wv_link_##name; }
34 #endif // __WVLINKERHACK_H