Version: 1.0.0
base/dlimpexp.h
Go to the documentation of this file.
1 #ifndef _WX_MLBASE_DLIMPEXP_H_
2 #define _WX_MLBASE_DLIMPEXP_H_
3 
4 #ifdef WXMAKINGDLL_MLBASE
5 # define WXDLLIMPEXP_MLBASE WXEXPORT
6 # define WXDLLIMPEXP_DATA_MLBASE(type) WXEXPORT type
7 # if defined(HAVE_VISIBILITY)
8 # define WXDLLIMPEXP_INLINE_MLBASE WXEXPORT
9 # else
10 # define WXDLLIMPEXP_INLINE_MLBASE
11 # endif
12 #elif defined(WXUSINGDLL)
13 # define WXDLLIMPEXP_MLBASE WXIMPORT
14 # define WXDLLIMPEXP_DATA_MLBASE(type) WXIMPORT type
15 # if defined(HAVE_VISIBILITY)
16 # define WXDLLIMPEXP_INLINE_MLBASE WXIMPORT
17 # else
18 # define WXDLLIMPEXP_INLINE_MLBASE
19 # endif
20 #else /* not making nor using DLL */
21 # define WXDLLIMPEXP_MLBASE
22 # define WXDLLIMPEXP_DATA_MLBASE(type) type
23 # define WXDLLIMPEXP_INLINE_MLBASE
24 #endif
25 
26 /*
27  GCC warns about using __attribute__ (and also __declspec in mingw32 case) on
28  forward declarations while MSVC complains about forward declarations without
29  __declspec for the classes later declared with it, so we need a separate set
30  of macros for forward declarations to hide this difference:
31  */
32 #if defined(HAVE_VISIBILITY) || (defined(__WINDOWS__) && defined(__GNUC__))
33  #define WXDLLIMPEXP_FWD_MLBASE
34 #else
35  #define WXDLLIMPEXP_FWD_MLBASE WXDLLIMPEXP_MLBASE
36 #endif
37 
38 /* for backwards compatibility, define suffix-less versions too */
39 //#define WXDLLEXPORT WXDLLIMPEXP_MLBASE
40 //#define WXDLLEXPORT_DATA WXDLLIMPEXP_DATA_MLBASE
41 
42 /*
43  MSVC up to 6.0 needs to be explicitly told to export template instantiations
44  used by the DLL clients, use this macro to do it like this:
45 
46  template <typename T> class Foo { ... };
47  WXDLLIMPEXP_TEMPLATE_INSTANCE_MLBASE( Foo<int> )
48 
49  (notice that currently we only need this for wxBase and wxCore libraries)
50  */
51 #if defined(__VISUALC__) && (__VISUALC__ <= 1200)
52  /*
53  We need to disable this warning when using this macro, as
54  recommended by Microsoft itself:
55 
56  http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b168958
57  */
58  #pragma warning(disable:4231)
59 
60  #define WXDLLIMPEXP_TEMPLATE_INSTANCE_MLBASE(decl) \
61  extern template class WXDLLIMPEXP_MLBASE decl;
62 #else /* not VC <= 6 */
63  #define WXDLLIMPEXP_TEMPLATE_INSTANCE_MLBASE(decl)
64 #endif /* VC6/others */
65 
66 #endif//_WX_MLBASE_DLIMPEXP_H