Version: 1.0.0
database/dlimpexp.h
Go to the documentation of this file.
1 #ifndef _WX_DATABASE_DLIMPEXP_H_
2 #define _WX_DATABASE_DLIMPEXP_H_
3 
4 #ifdef WXMAKINGDLL_DATABASE
5 # define WXDLLIMPEXP_DATABASE WXEXPORT
6 # define WXDLLIMPEXP_DATA_DATABASE(type) WXEXPORT type
7 # if defined(HAVE_VISIBILITY)
8 # define WXDLLIMPEXP_INLINE_DATABASE WXEXPORT
9 # else
10 # define WXDLLIMPEXP_INLINE_DATABASE
11 # endif
12 #elif defined(WXUSINGDLL)
13 # define WXDLLIMPEXP_DATABASE WXIMPORT
14 # define WXDLLIMPEXP_DATA_DATABASE(type) WXIMPORT type
15 # if defined(HAVE_VISIBILITY)
16 # define WXDLLIMPEXP_INLINE_DATABASE WXIMPORT
17 # else
18 # define WXDLLIMPEXP_INLINE_DATABASE
19 # endif
20 #else /* not making nor using DLL */
21 # define WXDLLIMPEXP_DATABASE
22 # define WXDLLIMPEXP_DATA_DATABASE(type) type
23 # define WXDLLIMPEXP_INLINE_DATABASE
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_DATABASE
34 #else
35  #define WXDLLIMPEXP_FWD_DATABASE WXDLLIMPEXP_DATABASE
36 #endif
37 
38 /* for backwards compatibility, define suffix-less versions too */
39 //#define WXDLLEXPORT WXDLLIMPEXP_DATABASE
40 //#define WXDLLEXPORT_DATA WXDLLIMPEXP_DATA_DATABASE
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_DATABASE( 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_DATABASE(decl) \
61  extern template class WXDLLIMPEXP_DATABASE decl;
62 #else /* not VC <= 6 */
63  #define WXDLLIMPEXP_TEMPLATE_INSTANCE_DATABASE(decl)
64 #endif /* VC6/others */
65 
66 #endif//_WX_DATABASE_DLIMPEXP_H