macos.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // (C) Copyright John Maddock 2001 - 2003.
  2. // (C) Copyright Darin Adler 2001 - 2002.
  3. // (C) Copyright Bill Kempf 2002.
  4. // Use, modification and distribution are subject to the
  5. // Boost Software License, Version 1.0. (See accompanying file
  6. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. // See http://www.boost.org for most recent version.
  8. // Mac OS specific config options:
  9. #define BOOST_PLATFORM "Mac OS"
  10. #if __MACH__ && !defined(_MSL_USING_MSL_C)
  11. // Using the Mac OS X system BSD-style C library.
  12. # ifndef BOOST_HAS_UNISTD_H
  13. # define BOOST_HAS_UNISTD_H
  14. # endif
  15. //
  16. // Begin by including our boilerplate code for POSIX
  17. // feature detection, this is safe even when using
  18. // the MSL as Metrowerks supply their own <unistd.h>
  19. // to replace the platform-native BSD one. G++ users
  20. // should also always be able to do this on MaxOS X.
  21. //
  22. # include <boost/config/detail/posix_features.hpp>
  23. # ifndef BOOST_HAS_STDINT_H
  24. # define BOOST_HAS_STDINT_H
  25. # endif
  26. //
  27. // BSD runtime has pthreads, sigaction, sched_yield and gettimeofday,
  28. // of these only pthreads are advertised in <unistd.h>, so set the
  29. // other options explicitly:
  30. //
  31. # define BOOST_HAS_SCHED_YIELD
  32. # define BOOST_HAS_GETTIMEOFDAY
  33. # define BOOST_HAS_SIGACTION
  34. # if (__GNUC__ < 3) && !defined( __APPLE_CC__)
  35. // GCC strange "ignore std" mode works better if you pretend everything
  36. // is in the std namespace, for the most part.
  37. # define BOOST_NO_STDC_NAMESPACE
  38. # endif
  39. # if (__GNUC__ >= 4)
  40. // Both gcc and intel require these.
  41. # define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
  42. # define BOOST_HAS_NANOSLEEP
  43. # endif
  44. #else
  45. // Using the MSL C library.
  46. // We will eventually support threads in non-Carbon builds, but we do
  47. // not support this yet.
  48. # if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON )
  49. # if !defined(BOOST_HAS_PTHREADS)
  50. // MPTasks support is deprecated/removed from Boost:
  51. //# define BOOST_HAS_MPTASKS
  52. # elif ( __dest_os == __mac_os_x )
  53. // We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the
  54. // gettimeofday and no posix.
  55. # define BOOST_HAS_GETTIMEOFDAY
  56. # endif
  57. #ifdef BOOST_HAS_PTHREADS
  58. # define BOOST_HAS_THREADS
  59. #endif
  60. // The remote call manager depends on this.
  61. # define BOOST_BIND_ENABLE_PASCAL
  62. # endif
  63. #endif