diff options
Diffstat (limited to 'source/blender/blenlib/BLI_compiler_attrs.h')
-rw-r--r-- | source/blender/blenlib/BLI_compiler_attrs.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_compiler_attrs.h b/source/blender/blenlib/BLI_compiler_attrs.h index 99f0aa9f049..f0566e0b3e2 100644 --- a/source/blender/blenlib/BLI_compiler_attrs.h +++ b/source/blender/blenlib/BLI_compiler_attrs.h @@ -25,7 +25,7 @@ #endif /* never returns NULL */ -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 /* gcc4.9+ only */ +#ifdef __GNUC__ # define ATTR_RETURNS_NONNULL __attribute__((returns_nonnull)) #else # define ATTR_RETURNS_NONNULL @@ -39,14 +39,14 @@ #endif /* hint to treat any non-null function return value cannot alias any other pointer */ -#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403)) +#ifdef __GNUC__ # define ATTR_MALLOC __attribute__((malloc)) #else # define ATTR_MALLOC #endif /* the function return value points to memory (2 args for 'size * tot') */ -#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403)) +#if defined(__GNUC__) && !defined(__clang__) # define ATTR_ALLOC_SIZE(args...) __attribute__((alloc_size(args))) #else # define ATTR_ALLOC_SIZE(...) @@ -69,7 +69,7 @@ /* Use to suppress '-Wimplicit-fallthrough' (in place of 'break'). */ #ifndef ATTR_FALLTHROUGH -# if defined(__GNUC__) && (__GNUC__ >= 7) /* gcc7.0+ only */ +# ifdef __GNUC__ # define ATTR_FALLTHROUGH __attribute__((fallthrough)) # else # define ATTR_FALLTHROUGH ((void)0) |