blob: c4da72205ebeaddbb4aba2658d2cfef61ea2231d [file] [log] [blame]
Georg Brandlfcaf9102008-07-16 02:17:56 +00001#ifndef PYMACCONFIG_H
2#define PYMACCONFIG_H
3 /*
4 * This file moves some of the autoconf magic to compile-time
5 * when building on MacOSX. This is needed for building 4-way
6 * universal binaries and for 64-bit universal binaries because
7 * the values redefined below aren't configure-time constant but
8 * only compile-time constant in these scenarios.
9 */
10
11#if defined(__APPLE__)
12
13# undef SIZEOF_LONG
14# undef SIZEOF_PTHREAD_T
15# undef SIZEOF_SIZE_T
16# undef SIZEOF_TIME_T
17# undef SIZEOF_VOID_P
Benjamin Petersonc39d7622008-12-30 17:56:45 +000018# undef SIZEOF__BOOL
Ronald Oussorenc2e1cb72009-12-01 15:55:14 +000019# undef SIZEOF_UINTPTR_T
20# undef SIZEOF_PTHREAD_T
Benjamin Petersonc39d7622008-12-30 17:56:45 +000021# undef WORDS_BIGENDIAN
Mark Dickinsonb08a53a2009-04-16 19:52:09 +000022# undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
23# undef DOUBLE_IS_BIG_ENDIAN_IEEE754
24# undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
Mark Dickinson0cd526e2009-04-25 18:22:27 +000025/* we don't ever need to play with the x87 control word on OS X/Intel, so just
26 pretend that we can't, to avoid problems on Intel+PPC builds */
27# undef HAVE_GCC_ASM_FOR_X87
Georg Brandlfcaf9102008-07-16 02:17:56 +000028
29# undef VA_LIST_IS_ARRAY
30# if defined(__LP64__) && defined(__x86_64__)
31# define VA_LIST_IS_ARRAY 1
32# endif
33
34# undef HAVE_LARGEFILE_SUPPORT
35# ifndef __LP64__
36# define HAVE_LARGEFILE_SUPPORT 1
37# endif
38
39# undef SIZEOF_LONG
40# ifdef __LP64__
Benjamin Petersonc39d7622008-12-30 17:56:45 +000041# define SIZEOF__BOOL 1
42# define SIZEOF__BOOL 1
Georg Brandlfcaf9102008-07-16 02:17:56 +000043# define SIZEOF_LONG 8
44# define SIZEOF_PTHREAD_T 8
45# define SIZEOF_SIZE_T 8
46# define SIZEOF_TIME_T 8
47# define SIZEOF_VOID_P 8
Ronald Oussorenc2e1cb72009-12-01 15:55:14 +000048# define SIZEOF_UINTPTR_T 8
49# define SIZEOF_PTHREAD_T 8
Georg Brandlfcaf9102008-07-16 02:17:56 +000050# else
Benjamin Petersonc39d7622008-12-30 17:56:45 +000051# ifdef __ppc__
52# define SIZEOF__BOOL 4
53# else
54# define SIZEOF__BOOL 1
55# endif
Georg Brandlfcaf9102008-07-16 02:17:56 +000056# define SIZEOF_LONG 4
57# define SIZEOF_PTHREAD_T 4
58# define SIZEOF_SIZE_T 4
59# define SIZEOF_TIME_T 4
60# define SIZEOF_VOID_P 4
Ronald Oussorenc2e1cb72009-12-01 15:55:14 +000061# define SIZEOF_UINTPTR_T 4
62# define SIZEOF_PTHREAD_T 4
Georg Brandlfcaf9102008-07-16 02:17:56 +000063# endif
64
65# if defined(__LP64__)
66 /* MacOSX 10.4 (the first release to suppport 64-bit code
67 * at all) only supports 64-bit in the UNIX layer.
68 * Therefore surpress the toolbox-glue in 64-bit mode.
69 */
70
71 /* In 64-bit mode setpgrp always has no argments, in 32-bit
72 * mode that depends on the compilation environment
73 */
74# undef SETPGRP_HAVE_ARG
75
76# endif
77
Benjamin Petersonc39d7622008-12-30 17:56:45 +000078#ifdef __BIG_ENDIAN__
79#define WORDS_BIGENDIAN 1
Mark Dickinsonb08a53a2009-04-16 19:52:09 +000080#define DOUBLE_IS_BIG_ENDIAN_IEEE754
81#else
82#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
Benjamin Petersonc39d7622008-12-30 17:56:45 +000083#endif /* __BIG_ENDIAN */
84
Ronald Oussoren1cc369c2009-04-19 10:40:48 +000085 /*
86 * The definition in pyconfig.h is only valid on the OS release
87 * where configure ran on and not necessarily for all systems where
88 * the executable can be used on.
89 *
90 * Specifically: OSX 10.4 has limited supported for '%zd', while
91 * 10.5 has full support for '%zd'. A binary built on 10.5 won't
92 * work properly on 10.4 unless we surpress the definition
93 * of PY_FORMAT_SIZE_T
94 */
95#undef PY_FORMAT_SIZE_T
96
Benjamin Petersonc39d7622008-12-30 17:56:45 +000097
Georg Brandlfcaf9102008-07-16 02:17:56 +000098#endif /* defined(_APPLE__) */
99
100#endif /* PYMACCONFIG_H */