select_stdlib_config.hpp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Boost compiler configuration selection header file
  2. // (C) Copyright John Maddock 2001 - 2003.
  3. // (C) Copyright Jens Maurer 2001 - 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. // locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed:
  9. // First, check if __has_include is available and <version> include can be located,
  10. // otherwise include <cstddef> to determine if some version of STLport is in use as the std lib
  11. // (do not rely on this header being included since users can short-circuit this header
  12. // if they know whose std lib they are using.)
  13. #if defined(__cplusplus) && defined(__has_include)
  14. # if __has_include(<version>)
  15. // It should be safe to include `<version>` when it is present without checking
  16. // the actual C++ language version as it consists solely of macro definitions.
  17. // [version.syn] p1: The header <version> supplies implementation-dependent
  18. // information about the C++ standard library (e.g., version number and release date).
  19. # include <version>
  20. # else
  21. # include <cstddef>
  22. # endif
  23. #elif defined(__cplusplus)
  24. # include <cstddef>
  25. #else
  26. # include <stddef.h>
  27. #endif
  28. #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
  29. // STLPort library; this _must_ come first, otherwise since
  30. // STLport typically sits on top of some other library, we
  31. // can end up detecting that first rather than STLport:
  32. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp"
  33. #else
  34. // If our std lib was not some version of STLport, and has not otherwise
  35. // been detected, then include <utility> as it is about
  36. // the smallest of the std lib headers that includes real C++ stuff.
  37. // Some std libs do not include their C++-related macros in <cstddef>
  38. // so this additional include makes sure we get those definitions.
  39. // Note: do not rely on this header being included since users can short-circuit this
  40. // #include if they know whose std lib they are using.
  41. #if !defined(__LIBCOMO__) && !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)\
  42. && !defined(_LIBCPP_VERSION) && !defined(__GLIBCPP__) && !defined(__GLIBCXX__)\
  43. && !defined(__STL_CONFIG_H) && !defined(__MSL_CPP__) && !defined(__IBMCPP__)\
  44. && !defined(MSIPL_COMPILE_H) && !defined(_YVALS) && !defined(_CPPLIB_VER)
  45. #include <utility>
  46. #endif
  47. #if defined(__LIBCOMO__)
  48. // Comeau STL:
  49. #define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcomo.hpp"
  50. #elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
  51. // Rogue Wave library:
  52. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp"
  53. #elif defined(_LIBCPP_VERSION)
  54. // libc++
  55. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcpp.hpp"
  56. #elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
  57. // GNU libstdc++ 3
  58. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp"
  59. #elif defined(__STL_CONFIG_H)
  60. // generic SGI STL
  61. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/sgi.hpp"
  62. #elif defined(__MSL_CPP__)
  63. // MSL standard lib:
  64. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/msl.hpp"
  65. #elif defined(__IBMCPP__) && defined(__COMPILER_VER__) && defined(__MVS__)
  66. // IBM z/OS XL C/C++
  67. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/xlcpp_zos.hpp"
  68. #elif defined(__IBMCPP__)
  69. // take the default VACPP std lib
  70. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/vacpp.hpp"
  71. #elif defined(MSIPL_COMPILE_H)
  72. // Modena C++ standard library
  73. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/modena.hpp"
  74. #elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
  75. // Dinkumware Library (this has to appear after any possible replacement libraries):
  76. # define BOOST_STDLIB_CONFIG "boost/config/stdlib/dinkumware.hpp"
  77. #elif defined (BOOST_ASSERT_CONFIG)
  78. // this must come last - generate an error if we don't
  79. // recognise the library:
  80. # error "Unknown standard library - please configure and report the results to boost.org"
  81. #endif
  82. #endif
  83. #if 0
  84. //
  85. // This section allows dependency scanners to find all the files we *might* include:
  86. //
  87. # include "boost/config/stdlib/stlport.hpp"
  88. # include "boost/config/stdlib/libcomo.hpp"
  89. # include "boost/config/stdlib/roguewave.hpp"
  90. # include "boost/config/stdlib/libcpp.hpp"
  91. # include "boost/config/stdlib/libstdcpp3.hpp"
  92. # include "boost/config/stdlib/sgi.hpp"
  93. # include "boost/config/stdlib/msl.hpp"
  94. # include "boost/config/stdlib/xlcpp_zos.hpp"
  95. # include "boost/config/stdlib/vacpp.hpp"
  96. # include "boost/config/stdlib/modena.hpp"
  97. # include "boost/config/stdlib/dinkumware.hpp"
  98. #endif