Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 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 | |
| 8 | // See http://www.boost.org for most recent version. |
| 9 | |
| 10 | // Mac OS specific config options: |
| 11 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 12 | #define NDNBOOST_PLATFORM "Mac OS" |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 13 | |
| 14 | #if __MACH__ && !defined(_MSL_USING_MSL_C) |
| 15 | |
| 16 | // Using the Mac OS X system BSD-style C library. |
| 17 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 18 | # ifndef NDNBOOST_HAS_UNISTD_H |
| 19 | # define NDNBOOST_HAS_UNISTD_H |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 20 | # endif |
| 21 | // |
| 22 | // Begin by including our boilerplate code for POSIX |
| 23 | // feature detection, this is safe even when using |
| 24 | // the MSL as Metrowerks supply their own <unistd.h> |
| 25 | // to replace the platform-native BSD one. G++ users |
| 26 | // should also always be able to do this on MaxOS X. |
| 27 | // |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 28 | # include <ndnboost/config/posix_features.hpp> |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 29 | # ifndef NDNBOOST_HAS_STDINT_H |
| 30 | # define NDNBOOST_HAS_STDINT_H |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 31 | # endif |
| 32 | |
| 33 | // |
| 34 | // BSD runtime has pthreads, sigaction, sched_yield and gettimeofday, |
| 35 | // of these only pthreads are advertised in <unistd.h>, so set the |
| 36 | // other options explicitly: |
| 37 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 38 | # define NDNBOOST_HAS_SCHED_YIELD |
| 39 | # define NDNBOOST_HAS_GETTIMEOFDAY |
| 40 | # define NDNBOOST_HAS_SIGACTION |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 41 | |
| 42 | # if (__GNUC__ < 3) && !defined( __APPLE_CC__) |
| 43 | |
| 44 | // GCC strange "ignore std" mode works better if you pretend everything |
| 45 | // is in the std namespace, for the most part. |
| 46 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 47 | # define NDNBOOST_NO_STDC_NAMESPACE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 48 | # endif |
| 49 | |
| 50 | # if (__GNUC__ == 4) |
| 51 | |
| 52 | // Both gcc and intel require these. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 53 | # define NDNBOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE |
| 54 | # define NDNBOOST_HAS_NANOSLEEP |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 55 | |
| 56 | # endif |
| 57 | |
| 58 | #else |
| 59 | |
| 60 | // Using the MSL C library. |
| 61 | |
| 62 | // We will eventually support threads in non-Carbon builds, but we do |
| 63 | // not support this yet. |
| 64 | # if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON ) |
| 65 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 66 | # if !defined(NDNBOOST_HAS_PTHREADS) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 67 | // MPTasks support is deprecated/removed from Boost: |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 68 | //# define NDNBOOST_HAS_MPTASKS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 69 | # elif ( __dest_os == __mac_os_x ) |
| 70 | // We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the |
| 71 | // gettimeofday and no posix. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 72 | # define NDNBOOST_HAS_GETTIMEOFDAY |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 73 | # endif |
| 74 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 75 | #ifdef NDNBOOST_HAS_PTHREADS |
| 76 | # define NDNBOOST_HAS_THREADS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 77 | #endif |
| 78 | |
| 79 | // The remote call manager depends on this. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 80 | # define NDNBOOST_BIND_ENABLE_PASCAL |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 81 | |
| 82 | # endif |
| 83 | |
| 84 | #endif |
| 85 | |
| 86 | |
| 87 | |