summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTakayuki MATSUOKA <takayuki.matsuoka@gmail.com>2016-11-19 13:08:48 (GMT)
committerTakayuki MATSUOKA <takayuki.matsuoka@gmail.com>2016-11-19 13:08:48 (GMT)
commitb4db9d7e35e67f509b6d6741efddd8ec087398a2 (patch)
treec2b995e925b569c649f5f21a5e6f0b68f2618fde /lib
parenta38cbf9f62a9d7200086b9965745ad7330cac259 (diff)
downloadlz4-b4db9d7e35e67f509b6d6741efddd8ec087398a2.zip
lz4-b4db9d7e35e67f509b6d6741efddd8ec087398a2.tar.gz
lz4-b4db9d7e35e67f509b6d6741efddd8ec087398a2.tar.bz2
Add C++14 standard [[deprecated]] attribute
See also For __cplusplus predefined macro, https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html For [[deprecated]] attribute, https://isocpp.org/wiki/faq/cpp14-language#deprecated-attribute
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/lz4.h b/lib/lz4.h
index 49854e4..7420ad8 100644
--- a/lib/lz4.h
+++ b/lib/lz4.h
@@ -413,7 +413,9 @@ union LZ4_streamDecode_u {
# define LZ4_DEPRECATED(message) /* disable deprecation warnings */
#else
# define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
-# if (LZ4_GCC_VERSION >= 405) || defined(__clang__)
+# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */
+# define LZ4_DEPRECATED(message) [[deprecated(message)]]
+# elif (LZ4_GCC_VERSION >= 405) || defined(__clang__)
# define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
# elif (LZ4_GCC_VERSION >= 301)
# define LZ4_DEPRECATED(message) __attribute__((deprecated))