cygwin.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // (C) Copyright John Maddock 2001 - 2003.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org for most recent version.
  6. // cygwin specific config options:
  7. #define BOOST_PLATFORM "Cygwin"
  8. #define BOOST_HAS_DIRENT_H
  9. #define BOOST_HAS_LOG1P
  10. #define BOOST_HAS_EXPM1
  11. //
  12. // Threading API:
  13. // See if we have POSIX threads, if we do use them, otherwise
  14. // revert to native Win threads.
  15. #define BOOST_HAS_UNISTD_H
  16. #include <unistd.h>
  17. #if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS)
  18. # define BOOST_HAS_PTHREADS
  19. # define BOOST_HAS_SCHED_YIELD
  20. # define BOOST_HAS_GETTIMEOFDAY
  21. # define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
  22. //# define BOOST_HAS_SIGACTION
  23. #else
  24. # if !defined(BOOST_HAS_WINTHREADS)
  25. # define BOOST_HAS_WINTHREADS
  26. # endif
  27. # define BOOST_HAS_FTIME
  28. #endif
  29. //
  30. // find out if we have a stdint.h, there should be a better way to do this:
  31. //
  32. #include <sys/types.h>
  33. #ifdef _STDINT_H
  34. #define BOOST_HAS_STDINT_H
  35. #endif
  36. #if __GNUC__ > 5 && !defined(BOOST_HAS_STDINT_H)
  37. # define BOOST_HAS_STDINT_H
  38. #endif
  39. #include <cygwin/version.h>
  40. #if (CYGWIN_VERSION_API_MAJOR == 0 && CYGWIN_VERSION_API_MINOR < 231)
  41. /// Cygwin has no fenv.h
  42. #define BOOST_NO_FENV_H
  43. #endif
  44. // Cygwin has it's own <pthread.h> which breaks <shared_mutex> unless the correct compiler flags are used:
  45. #ifndef BOOST_NO_CXX14_HDR_SHARED_MUTEX
  46. #include <pthread.h>
  47. #if !(__XSI_VISIBLE >= 500 || __POSIX_VISIBLE >= 200112)
  48. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  49. #endif
  50. #endif
  51. // boilerplate code:
  52. #include <boost/config/detail/posix_features.hpp>
  53. //
  54. // Cygwin lies about XSI conformance, there is no nl_types.h:
  55. //
  56. #ifdef BOOST_HAS_NL_TYPES_H
  57. # undef BOOST_HAS_NL_TYPES_H
  58. #endif