Skip to content

Commit

Permalink
config.h: enabled RET_NONNULL for GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Oct 23, 2024
1 parent d0afa2f commit 3726083
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@
# define DEPRECATED
#endif

// TODO: GCC apparently also supports this but there is no documentation on it
// returns_nonnull
#if __has_cpp_attribute (gnu::returns_nonnull)
# define RET_NONNULL [[gnu::returns_nonnull]]
#elif (defined(__clang__) && ((__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ >= 7))))
#elif (defined(__clang__) && ((__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ >= 7)))) \
|| (defined(__GNUC__) && (__GNUC__ >= 9))
# define RET_NONNULL __attribute__((returns_nonnull))
#else
# define RET_NONNULL
Expand Down

0 comments on commit 3726083

Please sign in to comment.