summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/contrib/proxy.cc2
-rw-r--r--apt-pkg/metaindex.cc2
-rw-r--r--apt-pkg/statechanges.cc2
-rw-r--r--apt-private/private-json-hooks.cc1
-rw-r--r--ftparchive/sources.cc2
-rwxr-xr-xprepare-release5
-rw-r--r--test/interactive-helper/createdeb-cve-2020-27350.cc2
-rw-r--r--test/interactive-helper/test_fileutl.cc2
-rw-r--r--test/libapt/extracttar_test.cc2
-rw-r--r--test/libapt/file-helpers.cc2
-rw-r--r--test/libapt/gtest_runner.cc4
11 files changed, 25 insertions, 1 deletions
diff --git a/apt-pkg/contrib/proxy.cc b/apt-pkg/contrib/proxy.cc
index 6dc3b0686..a99f44f49 100644
--- a/apt-pkg/contrib/proxy.cc
+++ b/apt-pkg/contrib/proxy.cc
@@ -7,6 +7,8 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#include <config.h>
+
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc
index fc03f3db0..97996b3f1 100644
--- a/apt-pkg/metaindex.cc
+++ b/apt-pkg/metaindex.cc
@@ -1,4 +1,6 @@
// Include Files /*{{{*/
+#include <config.h>
+
#include <apt-pkg/indexfile.h>
#include <apt-pkg/metaindex.h>
#include <apt-pkg/pkgcachegen.h>
diff --git a/apt-pkg/statechanges.cc b/apt-pkg/statechanges.cc
index 45468e462..bbcde71d3 100644
--- a/apt-pkg/statechanges.cc
+++ b/apt-pkg/statechanges.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/cacheset.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/debsystem.h>
diff --git a/apt-private/private-json-hooks.cc b/apt-private/private-json-hooks.cc
index a17204dda..ddf1c89d6 100644
--- a/apt-private/private-json-hooks.cc
+++ b/apt-private/private-json-hooks.cc
@@ -5,6 +5,7 @@
*
* SPDX-License-Identifier: GPL-2.0+
*/
+#include <config.h>
#include <apt-pkg/debsystem.h>
#include <apt-pkg/fileutl.h>
diff --git a/ftparchive/sources.cc b/ftparchive/sources.cc
index ee6efda05..a59224395 100644
--- a/ftparchive/sources.cc
+++ b/ftparchive/sources.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <sstream>
#include <string>
diff --git a/prepare-release b/prepare-release
index 39e2250bc..988ccabad 100755
--- a/prepare-release
+++ b/prepare-release
@@ -142,6 +142,11 @@ elif [ "$1" = 'post-build' ]; then
FAILED=true
fi
+ if [ "$(find -name '*.cc' ! -name 'tagfile-keys.cc' -exec grep --files-without-match '^#include <config\.h>$' '{}' \+ | wc -l)" != '0' ]; then
+ echo >&2 'WARNING: C++ files not including our config.h can cause ODR violations!'
+ find -name '*.cc' ! -name 'tagfile-keys.cc' -exec grep --files-without-match '^#include <config\.h>$' '{}' \+ >&2
+ FAILED=true
+ fi
if $REPORT_FAILURE && $FAILED; then
exit 1
fi
diff --git a/test/interactive-helper/createdeb-cve-2020-27350.cc b/test/interactive-helper/createdeb-cve-2020-27350.cc
index 7fc9b0e55..57c53ae91 100644
--- a/test/interactive-helper/createdeb-cve-2020-27350.cc
+++ b/test/interactive-helper/createdeb-cve-2020-27350.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
diff --git a/test/interactive-helper/test_fileutl.cc b/test/interactive-helper/test_fileutl.cc
index 6c29b748f..5569af1bf 100644
--- a/test/interactive-helper/test_fileutl.cc
+++ b/test/interactive-helper/test_fileutl.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/strutl.h>
diff --git a/test/libapt/extracttar_test.cc b/test/libapt/extracttar_test.cc
index ae74341e6..c945a0c68 100644
--- a/test/libapt/extracttar_test.cc
+++ b/test/libapt/extracttar_test.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/error.h>
#include <apt-pkg/dirstream.h>
#include <apt-pkg/extracttar.h>
diff --git a/test/libapt/file-helpers.cc b/test/libapt/file-helpers.cc
index 85fc6838e..bb7052b2a 100644
--- a/test/libapt/file-helpers.cc
+++ b/test/libapt/file-helpers.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/fileutl.h>
#include <string>
diff --git a/test/libapt/gtest_runner.cc b/test/libapt/gtest_runner.cc
index 5620aa0bd..09fc55d92 100644
--- a/test/libapt/gtest_runner.cc
+++ b/test/libapt/gtest_runner.cc
@@ -1,10 +1,12 @@
-#include <gtest/gtest.h>
+#include <config.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
#include <apt-pkg/pkgsystem.h>
+#include <gtest/gtest.h>
+
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
if (pkgInitSystem(*_config, _system) == false)