blob: b2cc0b74a7830b8ed8a6d4db635a984db2166b91 [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
19# undef WORDS_BIGENDIAN
Ronald Oussoren5640ce22008-06-05 12:58:24 +000020
21# undef VA_LIST_IS_ARRAY
22# if defined(__LP64__) && defined(__x86_64__)
23# define VA_LIST_IS_ARRAY 1
24# endif
25
26# undef HAVE_LARGEFILE_SUPPORT
27# ifndef __LP64__
28# define HAVE_LARGEFILE_SUPPORT 1
29# endif
30
31# undef SIZEOF_LONG
32# ifdef __LP64__
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000033# define SIZEOF__BOOL 1
34# define SIZEOF__BOOL 1
Ronald Oussoren5640ce22008-06-05 12:58:24 +000035# define SIZEOF_LONG 8
36# define SIZEOF_PTHREAD_T 8
37# define SIZEOF_SIZE_T 8
38# define SIZEOF_TIME_T 8
39# define SIZEOF_VOID_P 8
40# else
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000041# ifdef __ppc__
42# define SIZEOF__BOOL 4
43# else
44# define SIZEOF__BOOL 1
45# endif
Ronald Oussoren5640ce22008-06-05 12:58:24 +000046# define SIZEOF_LONG 4
47# define SIZEOF_PTHREAD_T 4
48# define SIZEOF_SIZE_T 4
49# define SIZEOF_TIME_T 4
50# define SIZEOF_VOID_P 4
51# endif
52
53# if defined(__LP64__)
54 /* MacOSX 10.4 (the first release to suppport 64-bit code
55 * at all) only supports 64-bit in the UNIX layer.
56 * Therefore surpress the toolbox-glue in 64-bit mode.
57 */
58
59 /* In 64-bit mode setpgrp always has no argments, in 32-bit
60 * mode that depends on the compilation environment
61 */
62# undef SETPGRP_HAVE_ARG
63
64# endif
65
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000066#ifdef __BIG_ENDIAN__
67#define WORDS_BIGENDIAN 1
68#endif /* __BIG_ENDIAN */
69
Ronald Oussoren6c0b8722009-04-19 10:38:20 +000070 /*
71 * The definition in pyconfig.h is only valid on the OS release
72 * where configure ran on and not necessarily for all systems where
73 * the executable can be used on.
74 *
75 * Specifically: OSX 10.4 has limited supported for '%zd', while
76 * 10.5 has full support for '%zd'. A binary built on 10.5 won't
77 * work properly on 10.4 unless we surpress the definition
78 * of PY_FORMAT_SIZE_T
79 */
80#undef PY_FORMAT_SIZE_T
81
Benjamin Petersonfd9633e2008-12-28 15:37:31 +000082
Ronald Oussoren5640ce22008-06-05 12:58:24 +000083#endif /* defined(_APPLE__) */
84
85#endif /* PYMACCONFIG_H */