[master] 2b9a15d Make vdef.h an "include only once" header

Poul-Henning Kamp phk at FreeBSD.org
Tue Oct 31 12:19:06 UTC 2017


commit 2b9a15d4319b1f471c9a04f8a730b8cb0ca12897
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Oct 31 12:18:35 2017 +0000

    Make vdef.h an "include only once" header

diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index 0da7a4b..0fb3a9b 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -42,7 +42,6 @@
 
 #include "vtc.h"
 
-#include "vdef.h"
 #include "vev.h"
 #include "vfil.h"
 #include "vnum.h"
diff --git a/include/vdef.h b/include/vdef.h
index efb23fb..4ab9e73 100644
--- a/include/vdef.h
+++ b/include/vdef.h
@@ -32,7 +32,9 @@
  *
  */
 
-#ifndef VDEF_H_INCLUDED
+#ifdef VDEF_H_INCLUDED
+#  error "vdef.h included multiple times"
+#endif
 #define VDEF_H_INCLUDED
 
 /* Safe printf into a fixed-size buffer */
@@ -160,5 +162,3 @@
 #   define ___Static_assert(x, y) \
 		typedef char __assert_## y[(x) ? 1 : -1] __unused
 #endif
-
-#endif /* VDEF_H_INCLUDED */


More information about the varnish-commit mailing list