Commit a710e767 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix universal binaries build on OSX, in case both 32 and 64 bit architectures are used

parent eb4656e5
...@@ -293,7 +293,29 @@ ...@@ -293,7 +293,29 @@
# define HAVE_CHAR 1 # define HAVE_CHAR 1
#endif #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 #if SIZEOF_CHARP
#define HAVE_CHARP 1 #define HAVE_CHARP 1
#define SIZEOF_VOIDP SIZEOF_CHARP #define SIZEOF_VOIDP SIZEOF_CHARP
...@@ -309,10 +331,6 @@ ...@@ -309,10 +331,6 @@
# define HAVE_INT 1 # define HAVE_INT 1
#endif #endif
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
#if SIZEOF_LONG
# define HAVE_LONG 1
#endif
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ #cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
#if SIZEOF_LONG_LONG #if SIZEOF_LONG_LONG
...@@ -329,7 +347,6 @@ ...@@ -329,7 +347,6 @@
#define HAVE_SIGSET_T 1 #define HAVE_SIGSET_T 1
#endif #endif
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
#if SIZEOF_SIZE_T #if SIZEOF_SIZE_T
#define HAVE_SIZE_T 1 #define HAVE_SIZE_T 1
#endif #endif
......
...@@ -687,14 +687,17 @@ ENDIF() ...@@ -687,14 +687,17 @@ ENDIF()
IF(HAVE_STDINT_H) IF(HAVE_STDINT_H)
SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h) SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h)
ENDIF(HAVE_STDINT_H) ENDIF(HAVE_STDINT_H)
IF(NOT APPLE)
CHECK_TYPE_SIZE("char *" SIZEOF_CHARP)
CHECK_TYPE_SIZE(long SIZEOF_LONG)
CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T)
ENDIF()
CHECK_TYPE_SIZE(char SIZEOF_CHAR) CHECK_TYPE_SIZE(char SIZEOF_CHAR)
CHECK_TYPE_SIZE("char *" SIZEOF_CHARP)
CHECK_TYPE_SIZE(short SIZEOF_SHORT) CHECK_TYPE_SIZE(short SIZEOF_SHORT)
CHECK_TYPE_SIZE(int SIZEOF_INT) CHECK_TYPE_SIZE(int SIZEOF_INT)
CHECK_TYPE_SIZE(long SIZEOF_LONG)
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h) SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h)
CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T)
SET(CMAKE_EXTRA_INCLUDE_FILES sys/types.h) SET(CMAKE_EXTRA_INCLUDE_FILES sys/types.h)
CHECK_TYPE_SIZE(off_t SIZEOF_OFF_T) CHECK_TYPE_SIZE(off_t SIZEOF_OFF_T)
CHECK_TYPE_SIZE(uchar SIZEOF_UCHAR) CHECK_TYPE_SIZE(uchar SIZEOF_UCHAR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment