summaryrefslogtreecommitdiff
path: root/config.h.cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@macbook.local>2009-11-26 00:47:38 +0100
committerVladislav Vaintroub <vvaintroub@macbook.local>2009-11-26 00:47:38 +0100
commita710e76783d9d0d31d2d279967d717589e026fb3 (patch)
tree558ac4878c2da54426a41b2f603003227aa1c5ff /config.h.cmake
parenteb4656e59ed0c6355720f6d0fc5a807ed2c7399d (diff)
downloadmariadb-git-a710e76783d9d0d31d2d279967d717589e026fb3.tar.gz
Fix universal binaries build on OSX, in case both 32 and 64 bit architectures are used
Diffstat (limited to 'config.h.cmake')
-rw-r--r--config.h.cmake29
1 files changed, 23 insertions, 6 deletions
diff --git a/config.h.cmake b/config.h.cmake
index 054777e9f43..e4dd2541f92 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -293,7 +293,29 @@
# define HAVE_CHAR 1
#endif
-#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@
+#ifdef __APPLE__
+ /*
+ Special handling required for OSX to support universal binaries that
+ mix 32 and 64 bit architectures.
+ */
+ #if(__LP64__)
+ #define SIZEOF_LONG 8
+ #else
+ #define SIZEOF_LONG 4
+ #endif
+ #define SIZEOF_CHARP SIZEOF_LONG
+ #define SIZEOF_SIZE_T SIZEOF_LONG
+#else
+ #cmakedefine SIZEOF_LONG @SIZEOF_LONG@
+ #cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@
+ #cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@
+#endif
+
+#if SIZEOF_LONG
+# define HAVE_LONG 1
+#endif
+
+
#if SIZEOF_CHARP
#define HAVE_CHARP 1
#define SIZEOF_VOIDP SIZEOF_CHARP
@@ -309,10 +331,6 @@
# define HAVE_INT 1
#endif
-#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
-#if SIZEOF_LONG
-# define HAVE_LONG 1
-#endif
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
#if SIZEOF_LONG_LONG
@@ -329,7 +347,6 @@
#define HAVE_SIGSET_T 1
#endif
-#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
#if SIZEOF_SIZE_T
#define HAVE_SIZE_T 1
#endif