[master] 2ac270567 Fix compilation on macOS Big Sur

Federico G. Schwindt fgsch at lodoss.net
Sun Jun 13 21:33:12 UTC 2021


commit 2ac2705675acc99f47695cf6800254bc2cbbd454
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Sun Jun 13 22:29:05 2021 +0100

    Fix compilation on macOS Big Sur
    
    Fixes:
    
    In file included from vev.c:36:
     /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:328:6: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
     #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
          ^
     /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:197:2: note: expanded from macro '_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT'
             defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1))

diff --git a/configure.ac b/configure.ac
index 553e9f43d..6a2874f8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -710,6 +710,14 @@ else
 	 OCFLAGS="${OCFLAGS} -Werror"])
 fi
 
+case $target in
+    *-*-darwin*)
+	AX_CHECK_COMPILE_FLAG([-Wno-expansion-to-defined],
+	[CFLAGS="${CFLAGS} -Wno-expansion-to-defined"
+	 OCFLAGS="${OCFLAGS} -Wno-expansion-to-defined"])
+	;;
+esac
+
 AX_CHECK_COMPILE_FLAG([-Werror=unused-result],
     [CFLAGS="${CFLAGS} -Wno-error=unused-result"
      OCFLAGS="${OCFLAGS} -Wno-error=unused-result"],


More information about the varnish-commit mailing list