[master] 5891cb0b6 vdef: Centralize __has_feature(...) fallback

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Apr 15 17:11:06 UTC 2021


commit 5891cb0b63562bfa1d7f0022343ea18a100c5d10
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Apr 15 19:07:01 2021 +0200

    vdef: Centralize __has_feature(...) fallback

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 6ead58a5f..24c5bfcda 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -45,10 +45,6 @@
 #include "vav.h"
 #include "vcli_serve.h"
 
-#if !defined(__has_feature)
-#define __has_feature(x)	0
-#endif
-
 struct plist {
 	unsigned			magic;
 #define PLIST_MAGIC			0xbfc3ea16
diff --git a/include/vdef.h b/include/vdef.h
index 5ba66828e..d99c02570 100644
--- a/include/vdef.h
+++ b/include/vdef.h
@@ -79,6 +79,10 @@
 		*(fdp) = -1;			\
 	} while (0)
 
+#if !defined(__has_feature)
+#  define __has_feature(x)	0
+#endif
+
 #ifndef __GNUC_PREREQ__
 # if defined __GNUC__ && defined __GNUC_MINOR__
 #  define __GNUC_PREREQ__(maj, min) \
diff --git a/lib/libvarnish/vbh.c b/lib/libvarnish/vbh.c
index 511e9e7de..ce7bd5fd9 100644
--- a/lib/libvarnish/vbh.c
+++ b/lib/libvarnish/vbh.c
@@ -48,10 +48,6 @@
 #include "vas.h"
 #include "vbh.h"
 
-#if !defined(__has_feature)
-#define __has_feature(x)	0
-#endif
-
 /* Parameters --------------------------------------------------------*/
 
 /*


More information about the varnish-commit mailing list