diff options
author | Andrei Pavel <andrei@isc.org> | 2021-10-20 14:03:16 +0200 |
---|---|---|
committer | Razvan Becheriu <razvan@isc.org> | 2021-10-20 17:22:19 +0200 |
commit | 8ce40a35c28371f03269b71bfa7386d6fed29453 (patch) | |
tree | 9b500005bcca92d9b641ffb98f7bf8cdcac12ad6 /m4macros | |
parent | [#1745] document vivso options (diff) | |
download | kea-8ce40a35c28371f03269b71bfa7386d6fed29453.tar.xz kea-8ce40a35c28371f03269b71bfa7386d6fed29453.zip |
[#2128] fix noreturn check for older compilers
Diffstat (limited to 'm4macros')
-rw-r--r-- | m4macros/ax_cpp11.m4 | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/m4macros/ax_cpp11.m4 b/m4macros/ax_cpp11.m4 index 86f3ec4359..65a7044c4b 100644 --- a/m4macros/ax_cpp11.m4 +++ b/m4macros/ax_cpp11.m4 @@ -1,10 +1,8 @@ AC_DEFUN([AX_ISC_CPP11], [ CXX_SAVED=$CXX -CPPFLAGS_SAVED=$CPPFLAGS feature= for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do - CPPFLAGS=$CPPFLAGS_SAVED if test "$retry" = "fail"; then AC_MSG_ERROR([$feature (a C++11 feature) is not supported]) fi @@ -227,38 +225,17 @@ for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do [AC_MSG_RESULT([no]) continue]) - AC_MSG_CHECKING(noreturn support) - feature="noreturn" - CPPFLAGS="-Werror=implicit-fallthrough -Wimplicit-fallthrough $CPPFLAGS" + AC_MSG_CHECKING(chrono support) + feature="chrono" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [#include <cstdlib> - [[[noreturn]]] void f() {exit(0);}], - [int i = 0; - switch (i) { - case 0: - f(); - default: - i++; - break; - }])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - continue]) - CPPFLAGS=$CPPFLAGS_SAVED - - AC_MSG_CHECKING(chrono support) - feature="chrono" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( [#include <chrono> using namespace std::chrono;], [auto now = high_resolution_clock::now();])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) continue]) - break - + break done ])dnl AX_ISC_CPP11 |