]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
gcc doesn't have __has_feature
authorNick Porter <nick@portercomputing.co.uk>
Tue, 3 Sep 2024 07:34:29 +0000 (08:34 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 3 Sep 2024 07:34:29 +0000 (08:34 +0100)
And the pre-processor appears to parse the whole line before determining
that __clang__ is not defined

src/include/build.h

index b4206e5898c039d4eea96fb53a963fbbffee1ad8..c704e2b7049429fbc867363b564e9fb71871574a 100644 (file)
@@ -413,6 +413,9 @@ do { \
 /*
  *      Disable various forms of ubsan
  */
+#ifndef __has_feature
+#  define __has_feature(_x) 0
+#endif
 #if defined(__clang__) && __has_feature(undefined_behavior_sanitizer)
 #  define CC_NO_UBSAN(_sanitize)        __attribute__((no_sanitize(STRINGIFY(_sanitize))))
 #elif __GNUC_PREREQ__(4, 9) && defined(__SANITIZE_UNDEFINED__)