|
1 |
| -#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 |
| - */ |
| 1 | +// This file moves some of the autoconf magic to compile-time when building on |
| 2 | +// macOS. This is needed for building 4-way universal binaries and for 64-bit |
| 3 | +// universal binaries because the values redefined below aren't configure-time |
| 4 | +// constant but only compile-time constant in these scenarios. |
10 | 5 |
|
11 |
| -#if defined(__APPLE__) |
| 6 | +#ifndef PY_MACCONFIG_H |
| 7 | +#define PY_MACCONFIG_H |
| 8 | +#ifdef __APPLE__ |
12 | 9 |
|
13 |
| -# undef SIZEOF_LONG |
14 |
| -# undef SIZEOF_PTHREAD_T |
15 |
| -# undef SIZEOF_SIZE_T |
16 |
| -# undef SIZEOF_TIME_T |
17 |
| -# undef SIZEOF_VOID_P |
18 |
| -# undef SIZEOF__BOOL |
19 |
| -# undef SIZEOF_UINTPTR_T |
20 |
| -# undef SIZEOF_PTHREAD_T |
21 |
| -# undef WORDS_BIGENDIAN |
22 |
| -# undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 |
23 |
| -# undef DOUBLE_IS_BIG_ENDIAN_IEEE754 |
24 |
| -# undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 |
25 |
| -# undef HAVE_GCC_ASM_FOR_X87 |
| 10 | +#undef SIZEOF_LONG |
| 11 | +#undef SIZEOF_PTHREAD_T |
| 12 | +#undef SIZEOF_SIZE_T |
| 13 | +#undef SIZEOF_TIME_T |
| 14 | +#undef SIZEOF_VOID_P |
| 15 | +#undef SIZEOF__BOOL |
| 16 | +#undef SIZEOF_UINTPTR_T |
| 17 | +#undef SIZEOF_PTHREAD_T |
| 18 | +#undef WORDS_BIGENDIAN |
| 19 | +#undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 |
| 20 | +#undef DOUBLE_IS_BIG_ENDIAN_IEEE754 |
| 21 | +#undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 |
| 22 | +#undef HAVE_GCC_ASM_FOR_X87 |
26 | 23 |
|
27 |
| -# undef VA_LIST_IS_ARRAY |
28 |
| -# if defined(__LP64__) && defined(__x86_64__) |
29 |
| -# define VA_LIST_IS_ARRAY 1 |
30 |
| -# endif |
31 |
| - |
32 |
| -# undef HAVE_LARGEFILE_SUPPORT |
33 |
| -# ifndef __LP64__ |
34 |
| -# define HAVE_LARGEFILE_SUPPORT 1 |
35 |
| -# endif |
36 |
| - |
37 |
| -# undef SIZEOF_LONG |
38 |
| -# ifdef __LP64__ |
39 |
| -# define SIZEOF__BOOL 1 |
40 |
| -# define SIZEOF__BOOL 1 |
41 |
| -# define SIZEOF_LONG 8 |
42 |
| -# define SIZEOF_PTHREAD_T 8 |
43 |
| -# define SIZEOF_SIZE_T 8 |
44 |
| -# define SIZEOF_TIME_T 8 |
45 |
| -# define SIZEOF_VOID_P 8 |
46 |
| -# define SIZEOF_UINTPTR_T 8 |
47 |
| -# define SIZEOF_PTHREAD_T 8 |
48 |
| -# else |
49 |
| -# ifdef __ppc__ |
50 |
| -# define SIZEOF__BOOL 4 |
51 |
| -# else |
52 |
| -# define SIZEOF__BOOL 1 |
53 |
| -# endif |
54 |
| -# define SIZEOF_LONG 4 |
55 |
| -# define SIZEOF_PTHREAD_T 4 |
56 |
| -# define SIZEOF_SIZE_T 4 |
57 |
| -# define SIZEOF_TIME_T 4 |
58 |
| -# define SIZEOF_VOID_P 4 |
59 |
| -# define SIZEOF_UINTPTR_T 4 |
60 |
| -# define SIZEOF_PTHREAD_T 4 |
61 |
| -# endif |
| 24 | +#undef VA_LIST_IS_ARRAY |
| 25 | +#if defined(__LP64__) && defined(__x86_64__) |
| 26 | +# define VA_LIST_IS_ARRAY 1 |
| 27 | +#endif |
62 | 28 |
|
63 |
| -# if defined(__LP64__) |
64 |
| - /* MacOSX 10.4 (the first release to support 64-bit code |
65 |
| - * at all) only supports 64-bit in the UNIX layer. |
66 |
| - * Therefore suppress the toolbox-glue in 64-bit mode. |
67 |
| - */ |
| 29 | +#undef HAVE_LARGEFILE_SUPPORT |
| 30 | +#ifndef __LP64__ |
| 31 | +# define HAVE_LARGEFILE_SUPPORT 1 |
| 32 | +#endif |
68 | 33 |
|
69 |
| - /* In 64-bit mode setpgrp always has no arguments, in 32-bit |
70 |
| - * mode that depends on the compilation environment |
71 |
| - */ |
72 |
| -# undef SETPGRP_HAVE_ARG |
| 34 | +#undef SIZEOF_LONG |
| 35 | +#ifdef __LP64__ |
| 36 | +# define SIZEOF__BOOL 1 |
| 37 | +# define SIZEOF__BOOL 1 |
| 38 | +# define SIZEOF_LONG 8 |
| 39 | +# define SIZEOF_PTHREAD_T 8 |
| 40 | +# define SIZEOF_SIZE_T 8 |
| 41 | +# define SIZEOF_TIME_T 8 |
| 42 | +# define SIZEOF_VOID_P 8 |
| 43 | +# define SIZEOF_UINTPTR_T 8 |
| 44 | +# define SIZEOF_PTHREAD_T 8 |
| 45 | +#else |
| 46 | +# ifdef __ppc__ |
| 47 | +# define SIZEOF__BOOL 4 |
| 48 | +# else |
| 49 | +# define SIZEOF__BOOL 1 |
| 50 | +# endif |
| 51 | +# define SIZEOF_LONG 4 |
| 52 | +# define SIZEOF_PTHREAD_T 4 |
| 53 | +# define SIZEOF_SIZE_T 4 |
| 54 | +# define SIZEOF_TIME_T 4 |
| 55 | +# define SIZEOF_VOID_P 4 |
| 56 | +# define SIZEOF_UINTPTR_T 4 |
| 57 | +# define SIZEOF_PTHREAD_T 4 |
| 58 | +#endif |
73 | 59 |
|
74 |
| -# endif |
| 60 | +// macOS 10.4 (the first release to support 64-bit code |
| 61 | +// at all) only supports 64-bit in the UNIX layer. |
| 62 | +// Therefore suppress the toolbox-glue in 64-bit mode. |
| 63 | +// |
| 64 | +// In 64-bit mode setpgrp always has no arguments, in 32-bit |
| 65 | +// mode that depends on the compilation environment |
| 66 | +#if defined(__LP64__) |
| 67 | +# undef SETPGRP_HAVE_ARG |
| 68 | +#endif |
75 | 69 |
|
76 | 70 | #ifdef __BIG_ENDIAN__
|
77 |
| -#define WORDS_BIGENDIAN 1 |
78 |
| -#define DOUBLE_IS_BIG_ENDIAN_IEEE754 |
| 71 | +# define WORDS_BIGENDIAN 1 |
| 72 | +# define DOUBLE_IS_BIG_ENDIAN_IEEE754 |
79 | 73 | #else
|
80 |
| -#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 |
81 |
| -#endif /* __BIG_ENDIAN */ |
| 74 | +# define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 |
| 75 | +#endif |
82 | 76 |
|
83 | 77 | #ifdef __i386__
|
84 |
| -# define HAVE_GCC_ASM_FOR_X87 |
| 78 | +# define HAVE_GCC_ASM_FOR_X87 |
85 | 79 | #endif
|
86 | 80 |
|
87 |
| - |
88 |
| -#endif /* defined(_APPLE__) */ |
89 |
| - |
90 |
| -#endif /* PYMACCONFIG_H */ |
| 81 | +#endif // __APPLE__ |
| 82 | +#endif // !PY_MACCONFIG_H |
0 commit comments