Skip to content

Commit 871b311

Browse files
Dani-Hubcdunn2001
authored andcommitted
Provide JSONCPP_DEPRECATED definitions for clang and gcc
1 parent cdbc35f commit 871b311

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/json/config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +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)))
75+
#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
76+
#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
77+
#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
7378
#endif
7479

7580
#if !defined(JSONCPP_DEPRECATED)

0 commit comments

Comments
 (0)