Skip to content

Commit 5003983

Browse files
Dani-Hubcdunn2001
authored andcommitted
Make preprocessor query robust against older gcc versions
1 parent 871b311 commit 5003983

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/json/config.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@
7070
#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008
7171
/// Indicates that the following function is deprecated.
7272
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
73-
#elif (defined(__clang__) && __has_attribute(deprecated)) || \
74-
(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
73+
#elif defined(__clang__) && defined(__has_feature)
74+
#if __has_feature(attribute_deprecated_with_message)
75+
#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
76+
#endif
77+
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
7578
#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
7679
#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
7780
#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))

0 commit comments

Comments
 (0)