pymacconfig.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. */
  10. #if defined(__APPLE__)
  11. # undef ALIGNOF_MAX_ALIGN_T
  12. # undef SIZEOF_LONG
  13. # undef SIZEOF_LONG_DOUBLE
  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
  26. # undef HAVE_GCC_ASM_FOR_X64
  27. # undef VA_LIST_IS_ARRAY
  28. # if defined(__LP64__) && defined(__x86_64__)
  29. # define VA_LIST_IS_ARRAY 1
  30. # endif
  31. # undef HAVE_LARGEFILE_SUPPORT
  32. # ifndef __LP64__
  33. # define HAVE_LARGEFILE_SUPPORT 1
  34. # endif
  35. # undef SIZEOF_LONG
  36. # ifdef __LP64__
  37. # define SIZEOF__BOOL 1
  38. # define SIZEOF__BOOL 1
  39. # define SIZEOF_LONG 8
  40. # define SIZEOF_PTHREAD_T 8
  41. # define SIZEOF_SIZE_T 8
  42. # define SIZEOF_TIME_T 8
  43. # define SIZEOF_VOID_P 8
  44. # define SIZEOF_UINTPTR_T 8
  45. # define SIZEOF_PTHREAD_T 8
  46. # else
  47. # ifdef __ppc__
  48. # define SIZEOF__BOOL 4
  49. # else
  50. # define SIZEOF__BOOL 1
  51. # endif
  52. # define SIZEOF_LONG 4
  53. # define SIZEOF_PTHREAD_T 4
  54. # define SIZEOF_SIZE_T 4
  55. # define SIZEOF_TIME_T 4
  56. # define SIZEOF_VOID_P 4
  57. # define SIZEOF_UINTPTR_T 4
  58. # define SIZEOF_PTHREAD_T 4
  59. # endif
  60. # if defined(__LP64__)
  61. /* MacOSX 10.4 (the first release to support 64-bit code
  62. * at all) only supports 64-bit in the UNIX layer.
  63. * Therefore suppress the toolbox-glue in 64-bit mode.
  64. */
  65. /* In 64-bit mode setpgrp always has no arguments, in 32-bit
  66. * mode that depends on the compilation environment
  67. */
  68. # undef SETPGRP_HAVE_ARG
  69. # endif
  70. #ifdef __BIG_ENDIAN__
  71. #define WORDS_BIGENDIAN 1
  72. #define DOUBLE_IS_BIG_ENDIAN_IEEE754
  73. #else
  74. #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
  75. #endif /* __BIG_ENDIAN */
  76. #if defined(__i386__) || defined(__x86_64__)
  77. # define HAVE_GCC_ASM_FOR_X87
  78. # define ALIGNOF_MAX_ALIGN_T 16
  79. # define HAVE_GCC_ASM_FOR_X64 1
  80. # define SIZEOF_LONG_DOUBLE 16
  81. #else
  82. # define ALIGNOF_MAX_ALIGN_T 8
  83. # define SIZEOF_LONG_DOUBLE 8
  84. #endif
  85. #endif /* defined(_APPLE__) */
  86. #endif /* PYMACCONFIG_H */