From ac35c9585fb734b7a19785d490c152e0b8cd4663 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sat, 22 Feb 2020 14:15:07 +0200 Subject: Use defined(__GNUC__) before __GNUC__ in preprocessor lines. This should silence the equivalent of -Wundef in compilers that don't define __GNUC__. --- src/liblzma/api/lzma.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/liblzma') diff --git a/src/liblzma/api/lzma.h b/src/liblzma/api/lzma.h index aa88e424..122dab80 100644 --- a/src/liblzma/api/lzma.h +++ b/src/liblzma/api/lzma.h @@ -224,7 +224,8 @@ # else # define lzma_nothrow throw() # endif -# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) +# elif defined(__GNUC__) && (__GNUC__ > 3 \ + || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) # define lzma_nothrow __attribute__((__nothrow__)) # else # define lzma_nothrow @@ -241,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 -- cgit v1.2.3