[master] 43c8e8dd4 Declare anonymous structs in VSC header files

Martin Blix Grydeland martin at varnish-software.com
Mon Oct 4 13:18:07 UTC 2021


commit 43c8e8dd443ebd3cf9c556c873a91f57fe864736
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri Sep 17 17:05:43 2021 +0200

    Declare anonymous structs in VSC header files
    
    Declare anonymous vsmw_cluster and vsc_seg structs in VSC header
    files. This is to silence errors when the header file is used in other
    contexts that don't know about these structs.

diff --git a/lib/libvsc/vsctool.py b/lib/libvsc/vsctool.py
index c9254b090..db2a396dc 100755
--- a/lib/libvsc/vsctool.py
+++ b/lib/libvsc/vsctool.py
@@ -195,6 +195,10 @@ class CounterSet(object):
         fo.write("#define VSC_" + self.name +
                  "_size PRNDUP(sizeof(" + self.struct + "))\n\n")
 
+        fo.write("struct vsmw_cluster;\n");
+        fo.write("struct vsc_seg;\n");
+        fo.write("\n");
+
         fo.write(self.struct + " *VSC_" + self.name + "_New")
         fo.write("(struct vsmw_cluster *,\n")
         fo.write("    struct vsc_seg **, const char *fmt, ...);\n")


More information about the varnish-commit mailing list