From 2ab2b1c2cdfb8952fc3e009a01f7b228bcca1e47 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 26 Jan 2021 18:25:09 -0800 Subject: [PATCH] fix: add header guard to graphviz_version.h To prevent users #including this multiple times getting compiler warnings. Closes #1929. --- CHANGELOG.md | 1 + Makefile.am | 3 ++- graphviz_version.h.cmake | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd0307eb9..853e75370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Makefile.am b/Makefile.am index f051e943c..e2f0cc6a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/graphviz_version.h.cmake b/graphviz_version.h.cmake index 7e6bb5835..645f29220 100644 --- a/graphviz_version.h.cmake +++ b/graphviz_version.h.cmake @@ -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/" -- 2.40.0