util/ByteOrder: check only __GNUC__

Assume GCC/clang is recent enough.
This commit is contained in:
Max Kellermann
2023-03-06 16:30:42 +01:00
parent abdbaf605e
commit ff239fff4f
3 changed files with 8 additions and 14 deletions

View File

@@ -47,7 +47,7 @@
#define CLANG_CHECK_VERSION(major, minor) \
(CLANG_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
#if CLANG_OR_GCC_VERSION(4,0)
#ifdef __GNUC__
/* GCC 4.x */
@@ -67,10 +67,8 @@
#endif
#if GCC_CHECK_VERSION(7,0)
#ifdef __GNUC__
#define gcc_fallthrough __attribute__((fallthrough))
#elif CLANG_CHECK_VERSION(10,0) && defined(__cplusplus)
#define gcc_fallthrough [[fallthrough]]
#else
#define gcc_fallthrough
#endif
@@ -78,7 +76,7 @@
#ifndef __cplusplus
/* plain C99 has "restrict" */
#define gcc_restrict restrict
#elif CLANG_OR_GCC_VERSION(4,0)
#elif defined(__GNUC__)
/* "__restrict__" is a GCC extension for C++ */
#define gcc_restrict __restrict__
#else