bsd.hpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // (C) Copyright John Maddock 2001 - 2003.
  2. // (C) Copyright Darin Adler 2001.
  3. // (C) Copyright Douglas Gregor 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. // generic BSD config options:
  9. #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
  10. #error "This platform is not BSD"
  11. #endif
  12. #ifdef __FreeBSD__
  13. #define BOOST_PLATFORM "FreeBSD " BOOST_STRINGIZE(__FreeBSD__)
  14. #elif defined(__NetBSD__)
  15. #define BOOST_PLATFORM "NetBSD " BOOST_STRINGIZE(__NetBSD__)
  16. #elif defined(__OpenBSD__)
  17. #define BOOST_PLATFORM "OpenBSD " BOOST_STRINGIZE(__OpenBSD__)
  18. #elif defined(__DragonFly__)
  19. #define BOOST_PLATFORM "DragonFly " BOOST_STRINGIZE(__DragonFly__)
  20. #endif
  21. //
  22. // is this the correct version check?
  23. // FreeBSD has <nl_types.h> but does not
  24. // advertise the fact in <unistd.h>:
  25. //
  26. #if (defined(__FreeBSD__) && (__FreeBSD__ >= 3)) \
  27. || defined(__OpenBSD__) || defined(__DragonFly__)
  28. # define BOOST_HAS_NL_TYPES_H
  29. #endif
  30. //
  31. // FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in <pthread.h>
  32. // and not in <unistd.h>
  33. //
  34. #if (defined(__FreeBSD__) && (__FreeBSD__ <= 3))\
  35. || defined(__OpenBSD__) || defined(__DragonFly__)
  36. # define BOOST_HAS_PTHREADS
  37. #endif
  38. //
  39. // No wide character support in the BSD header files:
  40. //
  41. #if defined(__NetBSD__)
  42. #define __NetBSD_GCC__ (__GNUC__ * 1000000 \
  43. + __GNUC_MINOR__ * 1000 \
  44. + __GNUC_PATCHLEVEL__)
  45. // XXX - the following is required until c++config.h
  46. // defines _GLIBCXX_HAVE_SWPRINTF and friends
  47. // or the preprocessor conditionals are removed
  48. // from the cwchar header.
  49. #define _GLIBCXX_HAVE_SWPRINTF 1
  50. #endif
  51. #if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \
  52. || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) \
  53. || defined(__OpenBSD__) || defined(__DragonFly__))
  54. # define BOOST_NO_CWCHAR
  55. #endif
  56. //
  57. // The BSD <ctype.h> has macros only, no functions:
  58. //
  59. #if !defined(__OpenBSD__) || defined(__DragonFly__)
  60. # define BOOST_NO_CTYPE_FUNCTIONS
  61. #endif
  62. //
  63. // thread API's not auto detected:
  64. //
  65. #define BOOST_HAS_SCHED_YIELD
  66. #define BOOST_HAS_NANOSLEEP
  67. #define BOOST_HAS_GETTIMEOFDAY
  68. #define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
  69. #define BOOST_HAS_SIGACTION
  70. #define BOOST_HAS_CLOCK_GETTIME
  71. // boilerplate code:
  72. #define BOOST_HAS_UNISTD_H
  73. #include <boost/config/detail/posix_features.hpp>