[master] c90c1d6 Nitpicking

Poul-Henning Kamp phk at FreeBSD.org
Sat Sep 23 10:16:09 UTC 2017


commit c90c1d6a768ac2531ea846fbde8795992c139f4e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat Sep 23 09:17:15 2017 +0000

    Nitpicking

diff --git a/include/vrt.h b/include/vrt.h
index b8e1323..8bba11d 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -94,6 +94,7 @@ struct stevedore;
 struct suckaddr;
 struct vcl;
 struct vmod;
+struct vmod_priv;
 struct vsb;
 struct vsl_log;
 struct ws;
@@ -346,7 +347,6 @@ VCL_VCL VRT_vcl_get(VRT_CTX, const char *);
 void VRT_vcl_rel(VRT_CTX, VCL_VCL);
 void VRT_vcl_select(VRT_CTX, VCL_VCL);
 
-struct vmod_priv;
 typedef void vmod_priv_free_f(void *);
 struct vmod_priv {
 	void			*priv;
diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index d2e7a30..6636f61 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -757,10 +757,9 @@ class vcc(object):
 		self.commit_files.append(fn)
 		fo = open(fn + ".tmp", "w")
 		write_c_file_warning(fo)
-		fo.write("struct vmod_priv;\n")
-		fo.write("\n")
-		fo.write("extern const struct vmod_data Vmod_%s_Data;\n" %
-			(self.modname))
+		fo.write("#ifndef VRT_H_INCLUDED\n")
+		fo.write('#  error "Include vrt.h first"\n')
+		fo.write("#endif\n")
 		fo.write("\n")
 
 		for j in self.contents:
@@ -793,7 +792,9 @@ class vcc(object):
 	def api(self, fo):
 		for i in (714, 759, 765):
 			fo.write("\n/*lint -esym(%d, Vmod_%s_Data) */\n" % (i, self.modname))
-		fo.write("const struct vmod_data Vmod_%s_Data = {\n" %
+		fo.write("\nextern const struct vmod_data Vmod_%s_Data;\n" %
+			(self.modname))
+		fo.write("\nconst struct vmod_data Vmod_%s_Data = {\n" %
 		    self.modname)
 		if strict_abi:
 			fo.write("\t.vrt_major =\t0,\n")


More information about the varnish-commit mailing list