Skip to content

Commit 3e255af

Browse files
author
Erik Froseth
committed
Detect C++11 features for Developer Studio
This patch enables various C++11 features if the code is compiled with Developer Studio compiler version 5.14 or higher.
1 parent b81438e commit 3e255af

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/rapidjson/rapidjson.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,8 @@ RAPIDJSON_NAMESPACE_END
549549
#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0
550550
#endif
551551
#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
552-
(defined(_MSC_VER) && _MSC_VER >= 1600)
552+
(defined(_MSC_VER) && _MSC_VER >= 1600) || \
553+
(defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
553554

554555
#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
555556
#else
@@ -561,7 +562,8 @@ RAPIDJSON_NAMESPACE_END
561562
#if defined(__clang__)
562563
#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept)
563564
#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
564-
(defined(_MSC_VER) && _MSC_VER >= 1900)
565+
(defined(_MSC_VER) && _MSC_VER >= 1900) || \
566+
(defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
565567
#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1
566568
#else
567569
#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0
@@ -586,7 +588,8 @@ RAPIDJSON_NAMESPACE_END
586588
#if defined(__clang__)
587589
#define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for)
588590
#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
589-
(defined(_MSC_VER) && _MSC_VER >= 1700)
591+
(defined(_MSC_VER) && _MSC_VER >= 1700) || \
592+
(defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
590593
#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1
591594
#else
592595
#define RAPIDJSON_HAS_CXX11_RANGE_FOR 0

0 commit comments

Comments
 (0)