/Include/pymacconfig.h

http://unladen-swallow.googlecode.com/ · C++ Header · 85 lines · 48 code · 13 blank · 24 comment · 3 complexity · 6f20fc738c5182a3cec2da5d24da6697 MD5 · raw file

  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 SIZEOF_LONG
  12. # undef SIZEOF_PTHREAD_T
  13. # undef SIZEOF_SIZE_T
  14. # undef SIZEOF_TIME_T
  15. # undef SIZEOF_VOID_P
  16. # undef SIZEOF__BOOL
  17. # undef WORDS_BIGENDIAN
  18. # undef VA_LIST_IS_ARRAY
  19. # if defined(__LP64__) && defined(__x86_64__)
  20. # define VA_LIST_IS_ARRAY 1
  21. # endif
  22. # undef HAVE_LARGEFILE_SUPPORT
  23. # ifndef __LP64__
  24. # define HAVE_LARGEFILE_SUPPORT 1
  25. # endif
  26. # undef SIZEOF_LONG
  27. # ifdef __LP64__
  28. # define SIZEOF__BOOL 1
  29. # define SIZEOF__BOOL 1
  30. # define SIZEOF_LONG 8
  31. # define SIZEOF_PTHREAD_T 8
  32. # define SIZEOF_SIZE_T 8
  33. # define SIZEOF_TIME_T 8
  34. # define SIZEOF_VOID_P 8
  35. # else
  36. # ifdef __ppc__
  37. # define SIZEOF__BOOL 4
  38. # else
  39. # define SIZEOF__BOOL 1
  40. # endif
  41. # define SIZEOF_LONG 4
  42. # define SIZEOF_PTHREAD_T 4
  43. # define SIZEOF_SIZE_T 4
  44. # define SIZEOF_TIME_T 4
  45. # define SIZEOF_VOID_P 4
  46. # endif
  47. # if defined(__LP64__)
  48. /* MacOSX 10.4 (the first release to suppport 64-bit code
  49. * at all) only supports 64-bit in the UNIX layer.
  50. * Therefore surpress the toolbox-glue in 64-bit mode.
  51. */
  52. /* In 64-bit mode setpgrp always has no argments, in 32-bit
  53. * mode that depends on the compilation environment
  54. */
  55. # undef SETPGRP_HAVE_ARG
  56. # endif
  57. #ifdef __BIG_ENDIAN__
  58. #define WORDS_BIGENDIAN 1
  59. #endif /* __BIG_ENDIAN */
  60. /*
  61. * The definition in pyconfig.h is only valid on the OS release
  62. * where configure ran on and not necessarily for all systems where
  63. * the executable can be used on.
  64. *
  65. * Specifically: OSX 10.4 has limited supported for '%zd', while
  66. * 10.5 has full support for '%zd'. A binary built on 10.5 won't
  67. * work properly on 10.4 unless we surpress the definition
  68. * of PY_FORMAT_SIZE_T
  69. */
  70. #undef PY_FORMAT_SIZE_T
  71. #endif /* defined(_APPLE__) */
  72. #endif /* PYMACCONFIG_H */