summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-10-30 14:54:18 +0100
committerJulian Andres Klode <jak@debian.org>2015-10-30 15:17:59 +0100
commit2c1e4917d9fac693033723742ec5d4d76fd74c76 (patch)
tree122cece55c17b06a89f25e8c6dfa75b3cf9764c0 /test
parent3129bd50d30dad985764436f147ad44bc54f2005 (diff)
cacheset: Fix compilation on new GCC in C++98 mode
Since gcc 4.9, the API for erase slightly changed. In commit 3dddcdf2432e78f37c74d8c76c2c519a8d935ab2 the existing checks for __cplusplus where changed to check the gcc version, as the __cplusplus check did nothing, because gcc 4.8 already provided the standard value in there. Fix the code to check for the gcc version in two more places, and change the existing checks to use a convenience macro.
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/header-compilation26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/integration/header-compilation b/test/integration/header-compilation
new file mode 100755
index 000000000..634504b71
--- /dev/null
+++ b/test/integration/header-compilation
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+
+(for i in $TESTDIR/../../build/include/apt-pkg/*.h; do echo "#include \"$i\""; done) > include.h
+
+
+testone() {
+ local cxx=$1
+ shift
+
+ if type $cxx 2>&1 1>/dev/null; then
+ testsuccess $cxx -c -o /dev/null include.h
+ testsuccess $cxx -c -o /dev/null -std=c++98 include.h
+ testsuccess $cxx -c -o /dev/null -std=c++11 include.h
+ else
+ msgskip "Compile $cxx is not installed"
+ fi
+}
+
+testone clang++
+testone g++
+testone g++-4.8