aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/api/lzma.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/liblzma/api/lzma.h')
-rw-r--r--src/liblzma/api/lzma.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/liblzma/api/lzma.h b/src/liblzma/api/lzma.h
index ce675a78..122dab80 100644
--- a/src/liblzma/api/lzma.h
+++ b/src/liblzma/api/lzma.h
@@ -219,8 +219,13 @@
*/
#ifndef lzma_nothrow
# if defined(__cplusplus)
-# define lzma_nothrow throw()
-# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+# if __cplusplus >= 201103L
+# define lzma_nothrow noexcept
+# else
+# define lzma_nothrow throw()
+# endif
+# elif defined(__GNUC__) && (__GNUC__ > 3 \
+ || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
# define lzma_nothrow __attribute__((__nothrow__))
# else
# define lzma_nothrow
@@ -237,7 +242,7 @@
* break anything if these are sometimes enabled and sometimes not, only
* affects warnings and optimizations.
*/
-#if __GNUC__ >= 3
+#if defined(__GNUC__) && __GNUC__ >= 3
# ifndef lzma_attribute
# define lzma_attribute(attr) __attribute__(attr)
# endif