]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't check for wxMac before overriding WORDS_BIGENDIAN based on compiler
authorDavid Elliott <dfe@tgwbd.org>
Wed, 24 Oct 2007 21:43:36 +0000 (21:43 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Wed, 24 Oct 2007 21:43:36 +0000 (21:43 +0000)
endianness definitions.  This allows any toolkit to be compiled universally
on OS X, not just wxMac.

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

include/wx/platform.h

index 7d32b43345b0bd99adc95830b176c43eec4ae764..9076e454eb523794d2420bf12ba70228736704dd 100644 (file)
 #    endif
 #endif
 
-#if defined (__WXMAC__)
-#    if ( !defined(__MACH__) || ( defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ ) )
-#        define WORDS_BIGENDIAN 1
-#    else
-#        undef WORDS_BIGENDIAN
-#    endif
+/*
+    Handle Darwin gcc universal compilation.  Don't do this in an Apple-
+    specific case since no sane compiler should be defining either
+    __BIG_ENDIAN__ or __LITTLE_ENDIAN__ unless it really is generating
+    code that will be hosted on a machine with the appropriate endianness.
+    If a compiler defines neither, assume the user or configure set
+    WORDS_BIGENDIAN appropriately.
+ */
+#if defined(__BIG_ENDIAN__)
+#    undef WORDS_BIGENDIAN
+#    define WORDS_BIGENDIAN 1
+#elif defined(__LITTLE_ENDIAN__)
+#    undef WORDS_BIGENDIAN
+#elif defined(__WXMAC__) && !defined(WORDS_BIGENDIAN)
+/*  According to Stefan even ancient Mac compilers defined __BIG_ENDIAN__ */
+#    warning "Compiling wxMac with probably wrong endianness"
 #endif
 
 /*