optional_xconfig_HACK_TO_LIST_PREDEFINED_MACROS.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright (C) 2015 - 2018 Andrzej Krzemienski.
  2. //
  3. // Use, modification, and distribution is subject to the Boost Software
  4. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/lib/optional for documentation.
  8. //
  9. // You are welcome to contact the author at:
  10. // akrzemi1@gmail.com
  11. #include "boost/core/lightweight_test.hpp"
  12. #include "boost/optional/detail/optional_config.hpp"
  13. #include "boost/predef.h"
  14. #include <string>
  15. int main()
  16. {
  17. #if defined(__GNUC__)
  18. std::string emptys;
  19. #ifdef BOOST_INTEL_CXX_VERSION
  20. BOOST_TEST_EQ(emptys, "HAS INTEL INSIDE");
  21. #else
  22. BOOST_TEST_EQ(emptys, "NO INTEL INSIDE");
  23. #endif
  24. #if !defined BOOST_NO_CXX11_RVALUE_REFERENCES
  25. BOOST_TEST_EQ(emptys, "HAS RVALUE REFS");
  26. #else
  27. BOOST_TEST_EQ(emptys, "NO RVALUE REFS");
  28. #endif
  29. int empty = -1;
  30. BOOST_TEST_EQ(empty, __GNUC__);
  31. BOOST_TEST_EQ(empty, __GNUC_MINOR__);
  32. BOOST_TEST_EQ(empty, __GNUC_PATCHLEVEL__);
  33. BOOST_TEST_EQ(empty, __cplusplus);
  34. #endif
  35. BOOST_TEST_EQ(empty, BOOST_COMP_GNUC);
  36. BOOST_TEST_EQ(empty, BOOST_COMP_CLANG);
  37. BOOST_TEST_EQ(empty, BOOST_LANG_STDCPP);
  38. BOOST_TEST_EQ(empty, BOOST_LIB_C_GNU);
  39. BOOST_TEST_EQ(empty, BOOST_LIB_STD_GNU);
  40. BOOST_TEST_EQ(empty, BOOST_LIB_STD_CXX);
  41. return boost::report_errors();
  42. }