bsd.hpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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)) || defined(__DragonFly__)
  27. # define BOOST_HAS_NL_TYPES_H
  28. #endif
  29. //
  30. // FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in <pthread.h>
  31. // and not in <unistd.h>
  32. //
  33. #if (defined(__FreeBSD__) && (__FreeBSD__ <= 3))\
  34. || defined(__OpenBSD__) || defined(__DragonFly__)
  35. # define BOOST_HAS_PTHREADS
  36. #endif
  37. //
  38. // No wide character support in the BSD header files:
  39. //
  40. #if defined(__NetBSD__)
  41. #define __NetBSD_GCC__ (__GNUC__ * 1000000 \
  42. + __GNUC_MINOR__ * 1000 \
  43. + __GNUC_PATCHLEVEL__)
  44. // XXX - the following is required until c++config.h
  45. // defines _GLIBCXX_HAVE_SWPRINTF and friends
  46. // or the preprocessor conditionals are removed
  47. // from the cwchar header.
  48. #define _GLIBCXX_HAVE_SWPRINTF 1
  49. #endif
  50. #if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \
  51. || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) || defined(__DragonFly__))
  52. # define BOOST_NO_CWCHAR
  53. #endif
  54. //
  55. // The BSD <ctype.h> has macros only, no functions:
  56. //
  57. #if !defined(__OpenBSD__) || defined(__DragonFly__)
  58. # define BOOST_NO_CTYPE_FUNCTIONS
  59. #endif
  60. //
  61. // thread API's not auto detected:
  62. //
  63. #define BOOST_HAS_SCHED_YIELD
  64. #define BOOST_HAS_NANOSLEEP
  65. #define BOOST_HAS_GETTIMEOFDAY
  66. #define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
  67. #define BOOST_HAS_SIGACTION
  68. // boilerplate code:
  69. #define BOOST_HAS_UNISTD_H
  70. #include <boost/config/detail/posix_features.hpp>