macos.hpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/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. # define BOOST_HAS_MPTASKS
  51. # elif ( __dest_os == __mac_os_x )
  52. // We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the
  53. // gettimeofday and no posix.
  54. # define BOOST_HAS_GETTIMEOFDAY
  55. # endif
  56. // The MP task implementation of Boost Threads aims to replace MP-unsafe
  57. // parts of the MSL, so we turn on threads unconditionally.
  58. # define BOOST_HAS_THREADS
  59. // The remote call manager depends on this.
  60. # define BOOST_BIND_ENABLE_PASCAL
  61. # endif
  62. #endif