blob: fcfbf584a4d89b61bce21c33055a5978e4401b44 [file] [log] [blame]
Ronald Oussoren5640ce22008-06-05 12:58:24 +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 Petersonfd9633e2008-12-28 15:37:31 +000018# undef SIZEOF__BOOL
Ronald Oussoren7072f742009-12-01 15:54:01 +000019# undef SIZEOF_UINTPTR_T
20# undef SIZEOF_PTHREAD_T
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000021# undef WORDS_BIGENDIAN
Mark Dickinson1d6e2e12009-10-24 13:28:38 +000022# undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
23# undef DOUBLE_IS_BIG_ENDIAN_IEEE754
24# undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
Ronald Oussoren5640ce22008-06-05 12:58:24 +000025
26# undef VA_LIST_IS_ARRAY
27# if defined(__LP64__) && defined(__x86_64__)
28# define VA_LIST_IS_ARRAY 1
29# endif
30
31# undef HAVE_LARGEFILE_SUPPORT
32# ifndef __LP64__
33# define HAVE_LARGEFILE_SUPPORT 1
34# endif
35
36# undef SIZEOF_LONG
37# ifdef __LP64__
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000038# define SIZEOF__BOOL 1
39# define SIZEOF__BOOL 1
Ronald Oussoren5640ce22008-06-05 12:58:24 +000040# define SIZEOF_LONG 8
41# define SIZEOF_PTHREAD_T 8
42# define SIZEOF_SIZE_T 8
43# define SIZEOF_TIME_T 8
44# define SIZEOF_VOID_P 8
Ronald Oussoren7072f742009-12-01 15:54:01 +000045# define SIZEOF_UINTPTR_T 8
46# define SIZEOF_PTHREAD_T 8
Ronald Oussoren5640ce22008-06-05 12:58:24 +000047# else
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000048# ifdef __ppc__
49# define SIZEOF__BOOL 4
50# else
51# define SIZEOF__BOOL 1
52# endif
Ronald Oussoren5640ce22008-06-05 12:58:24 +000053# define SIZEOF_LONG 4
54# define SIZEOF_PTHREAD_T 4
55# define SIZEOF_SIZE_T 4
56# define SIZEOF_TIME_T 4
57# define SIZEOF_VOID_P 4
Ronald Oussoren7072f742009-12-01 15:54:01 +000058# define SIZEOF_UINTPTR_T 4
59# define SIZEOF_PTHREAD_T 4
Ronald Oussoren5640ce22008-06-05 12:58:24 +000060# endif
61
62# if defined(__LP64__)
63 /* MacOSX 10.4 (the first release to suppport 64-bit code
64 * at all) only supports 64-bit in the UNIX layer.
65 * Therefore surpress the toolbox-glue in 64-bit mode.
66 */
67
68 /* In 64-bit mode setpgrp always has no argments, in 32-bit
69 * mode that depends on the compilation environment
70 */
71# undef SETPGRP_HAVE_ARG
72
73# endif
74
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000075#ifdef __BIG_ENDIAN__
76#define WORDS_BIGENDIAN 1
Mark Dickinson1d6e2e12009-10-24 13:28:38 +000077#define DOUBLE_IS_BIG_ENDIAN_IEEE754
78#else
79#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000080#endif /* __BIG_ENDIAN */
81
Ronald Oussoren6c0b8722009-04-19 10:38:20 +000082 /*
83 * The definition in pyconfig.h is only valid on the OS release
84 * where configure ran on and not necessarily for all systems where
85 * the executable can be used on.
86 *
87 * Specifically: OSX 10.4 has limited supported for '%zd', while
88 * 10.5 has full support for '%zd'. A binary built on 10.5 won't
89 * work properly on 10.4 unless we surpress the definition
90 * of PY_FORMAT_SIZE_T
91 */
92#undef PY_FORMAT_SIZE_T
93
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000094
Ronald Oussoren5640ce22008-06-05 12:58:24 +000095#endif /* defined(_APPLE__) */
96
97#endif /* PYMACCONFIG_H */