]> granicus.if.org Git - graphviz/commitdiff
fix: add header guard to graphviz_version.h
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 27 Jan 2021 02:25:09 +0000 (18:25 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 3 Feb 2021 01:09:49 +0000 (17:09 -0800)
To prevent users #including this multiple times getting compiler warnings.
Closes #1929.

CHANGELOG.md
Makefile.am
graphviz_version.h.cmake

index fd0307eb948342cbbded5e1f034377c6c796e224..853e75370c1de7a5ed5145ecccf295b81f9ce4e7 100644 (file)
@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - typo in pathcross #1926
 - Out-of-bounds write caused by incorrect error handling of malloc in genUserdata #1928
 - Offer .tar.xz files too #454
+- Header file graphviz_version.h has no include guards #1929
 
 ## [2.46.0] - 2021-01-18
 
index f051e943c91289143a86bc3dc9f41735c40ec318..e2f0cc6a004af54fb35093f320652e436d4d0529 100644 (file)
@@ -35,7 +35,8 @@ dist-hook:
 BUILT_SOURCES = $(top_builddir)/graphviz_version.h
 
 $(top_builddir)/graphviz_version.h: config.h
-       $(EGREP) 'PACKAGE|VERSION|GVPLUGIN' config.h > $(top_builddir)/graphviz_version.h
+       printf '#pragma once\n' > $(top_builddir)/graphviz_version.h
+       $(EGREP) 'PACKAGE|VERSION|GVPLUGIN' config.h >> $(top_builddir)/graphviz_version.h
 
 EXTRA_DIST = $(txt) $(html) graphviz.spec \
        autogen.sh config/depcomp config/config.rpath \
index 7e6bb5835c72ec54c31f7897aa7786430a1234ab..645f292202f2b13cfa95bed0cad1fe198cbab9bc 100644 (file)
@@ -1,3 +1,4 @@
+#pragma once
 #define GVPLUGIN_CONFIG_FILE "config@GRAPHVIZ_PLUGIN_VERSION@"
 #define GVPLUGIN_VERSION @GRAPHVIZ_PLUGIN_VERSION@
 #define PACKAGE_BUGREPORT "http://www.graphviz.org/"