]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/build.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: Runtime build options checking
4 // Author: Vadim Zeitlin, Vaclav Slavik
7 // Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
14 #include "wx/version.h"
16 // NB: This file contains macros for checking binary compatibility of libraries
17 // in multilib builds, plugins and user components.
18 // The WX_BUILD_OPTIONS_SIGNATURE macro expands into string that should
19 // uniquely identify binary compatible builds: i.e. if two builds of the
20 // library are binary compatible, their signature string should be the
21 // same; if two builds are binary incompatible, their signatures should
24 // Therefore, wxUSE_XXX flags that affect binary compatibility (vtables,
25 // function signatures) should be accounted for here. So should compilers
26 // and compiler versions (but note that binary compatible compiler versions
27 // such as gcc-2.95.2 and gcc-2.95.3 should have same signature!).
29 // ----------------------------------------------------------------------------
30 // WX_BUILD_OPTIONS_SIGNATURE
31 // ----------------------------------------------------------------------------
33 #define __WX_BO_STRINGIZE(x) __WX_BO_STRINGIZE0(x)
34 #define __WX_BO_STRINGIZE0(x) #x
36 #if (wxMINOR_VERSION % 2) == 0
37 #define __WX_BO_VERSION(x,y,z) \
38 __WX_BO_STRINGIZE(x) "." __WX_BO_STRINGIZE(y)
40 #define __WX_BO_VERSION(x,y,z) \
41 __WX_BO_STRINGIZE(x) "." __WX_BO_STRINGIZE(y) "." __WX_BO_STRINGIZE(z)
44 #if wxUSE_UNICODE_UTF8
45 #define __WX_BO_UNICODE "UTF-8"
46 #elif wxUSE_UNICODE_WCHAR
47 #define __WX_BO_UNICODE "wchar_t"
49 #define __WX_BO_UNICODE "ANSI"
52 // GCC and Intel C++ share same C++ ABI (and possibly others in the future),
53 // check if compiler versions are compatible:
54 #if defined(__GXX_ABI_VERSION)
55 #define __WX_BO_COMPILER \
56 ",compiler with C++ ABI " __WX_BO_STRINGIZE(__GXX_ABI_VERSION)
57 #elif defined(__INTEL_COMPILER)
58 #define __WX_BO_COMPILER ",Intel C++"
59 #elif defined(__GNUG__)
60 #define __WX_BO_COMPILER ",GCC " \
61 __WX_BO_STRINGIZE(__GNUC__) "." __WX_BO_STRINGIZE(__GNUC_MINOR__)
62 #elif defined(__VISUALC__)
63 #define __WX_BO_COMPILER ",Visual C++ " __WX_BO_STRINGIZE(_MSC_VER)
64 #elif defined(__BORLANDC__)
65 #define __WX_BO_COMPILER ",Borland C++"
66 #elif defined(__DIGITALMARS__)
67 #define __WX_BO_COMPILER ",DigitalMars"
68 #elif defined(__WATCOMC__)
69 #define __WX_BO_COMPILER ",Watcom C++"
71 #define __WX_BO_COMPILER
74 // WXWIN_COMPATIBILITY macros affect presence of virtual functions
75 #if WXWIN_COMPATIBILITY_2_6
76 #define __WX_BO_WXWIN_COMPAT_2_6 ",compatible with 2.6"
78 #define __WX_BO_WXWIN_COMPAT_2_6
80 #if WXWIN_COMPATIBILITY_2_8
81 #define __WX_BO_WXWIN_COMPAT_2_8 ",compatible with 2.8"
83 #define __WX_BO_WXWIN_COMPAT_2_8
86 // deriving wxWin containers from STL ones changes them completely:
87 #if wxUSE_STD_CONTAINERS
88 #define __WX_BO_STL ",STL containers"
90 #define __WX_BO_STL ",wx containers"
93 // This macro is passed as argument to wxConsoleApp::CheckBuildOptions()
94 #define WX_BUILD_OPTIONS_SIGNATURE \
95 __WX_BO_VERSION(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) \
96 " (" __WX_BO_UNICODE \
99 __WX_BO_WXWIN_COMPAT_2_6 __WX_BO_WXWIN_COMPAT_2_8 \
103 // ----------------------------------------------------------------------------
104 // WX_CHECK_BUILD_OPTIONS
105 // ----------------------------------------------------------------------------
107 // Use this macro to check build options. Adding it to a file in DLL will
108 // ensure that the DLL checks build options in same way wxIMPLEMENT_APP() does.
109 #define WX_CHECK_BUILD_OPTIONS(libName) \
110 static struct wxBuildOptionsChecker \
112 wxBuildOptionsChecker() \
114 wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \
117 } gs_buildOptionsCheck;
120 #endif // _WX_BUILD_H_