]> git.saurik.com Git - wxWidgets.git/commitdiff
Define __WXOSX__ and __WXMAC__ on compiler command line.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 9 Oct 2009 13:05:38 +0000 (13:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 9 Oct 2009 13:05:38 +0000 (13:05 +0000)
Although __WXMAC__ and __WXMAC__ were already defined in wx/platform.h if
__WXOSX_XXX__ was defined, they couldn't be used for checks done before
including this header, which was surprising and, in case of __WXMAC__,
backwards incompatible. Define them now on the compiler command line to ensure
that they are always defined.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure
configure.in
include/wx/platform.h

index aecc77a4104b4207216fa37f9c389dafe338a651..568bfc4aba75af6485b8bceef6db3eb415512dcd 100755 (executable)
--- a/configure
+++ b/configure
@@ -32813,11 +32813,15 @@ echo "${ECHO_T}none" >&6; }
         TOOLKIT=OSX_CARBON
                 GUIDIST=OSX_CARBON_DIST
                         WXBASEPORT="_carbon"
+
+                                        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
     fi
 
     if test "$wxUSE_OSX_COCOA" = 1; then
         TOOLKIT=OSX_COCOA
         GUIDIST=OSX_COCOA_DIST
+
+                TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
     fi
 
     if test "$wxUSE_COCOA" = 1; then
index 7d7c54f7549605ba857539de35ec4d914ebc8511..51b2465987ad4fa2f129275e5fe388454a5bad53 100644 (file)
@@ -3469,11 +3469,20 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
         dnl wxMac version of wxBase and wxCocoa or wxBase-only built on Darwin
         dnl are different, so they need different names:
         WXBASEPORT="_carbon"
+
+        dnl in addition to defining __WXOSX_CARBON__ for this toolkit we want
+        dnl to also define these extra symbols to make it possible to test for
+        dnl any Mac port (__WXMAC__ is for backwards compatibility, __WXOSX__
+        dnl is a new name)
+        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
     fi
 
     if test "$wxUSE_OSX_COCOA" = 1; then
         TOOLKIT=OSX_COCOA
         GUIDIST=OSX_COCOA_DIST
+
+        dnl see the comment above in wxUSE_OSX_CARBON branch
+        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
     fi
 
     if test "$wxUSE_COCOA" = 1; then
index abb2278afbf22a3500be8beed245cd3445c136f0..373b267bc5683add80a208d08acd3075c2a2dda2 100644 (file)
     __WXOSX_IPHONE__ means OS X iPhone
 */
 
-/* backwards compatible define, until configure gets updated */
-#if defined __WXMAC__
-#define __WXOSX_CARBON__ 1
-#endif
+/*
+    Normally all of __WXOSX_XXX__, __WXOSX__ and __WXMAC__ are defined by
+    configure but ensure that we also define them if configure was not used for
+    whatever reason.
 
+    The primare symbol remains __WXOSX_XXX__ one, __WXOSX__ exists to allow
+    checking for any OS X port (Carbon and Cocoa) and __WXMAC__ is an old name
+    for it.
+ */
 #if defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__)
-#   define __WXOSX__ 1
-#endif
-
-#ifdef __WXOSX__
-/* for backwards compatibility of code (including our own) define __WXMAC__ */
+#   ifndef __WXOSX__
+#       define __WXOSX__ 1
+#   endif
 #   ifndef __WXMAC__
 #       define __WXMAC__ 1
 #   endif
+#endif
+
+#ifdef __WXOSX__
 /* setup precise defines according to sdk used */
 #   include <TargetConditionals.h>
 #   if defined(__WXOSX_IPHONE__)