]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5077] Added lambda (and auto as a side effect) C++ feature check
authorFrancis Dupont <fdupont@isc.org>
Fri, 16 Dec 2016 12:01:55 +0000 (13:01 +0100)
committerFrancis Dupont <fdupont@isc.org>
Fri, 16 Dec 2016 12:01:55 +0000 (13:01 +0100)
configure.ac

index 8e298eb92a21ffa5873d326de8825930d881804b..414529412504d5358a8781d1c0cd8dc31b229685 100644 (file)
@@ -117,7 +117,7 @@ AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
 # USE_CLANGPP is no longer used, keep it by summetry with USE_GXX?
 AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
 
-# Check for std::unique_ptr and aggregate initialization (aka C++11) support
+# Check for C++11 features support
 CXX_SAVED=$CXX
 feature=
 for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
@@ -146,6 +146,16 @@ for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
                [AC_LANG_PROGRAM(
                        [#include <vector>],
                        [std::vector<int> foo = { 1, 2, 3};])],
+               [AC_MSG_RESULT([yes])],
+               [AC_MSG_RESULT([no])
+                continue])
+
+       AC_MSG_CHECKING(lambda support)
+       feature="lambda"
+       AC_COMPILE_IFELSE(
+               [AC_LANG_PROGRAM(
+                       [],
+                       [auto incr = [[]](int x) { return x + 1; };])],
                [AC_MSG_RESULT([yes])
                 break],
                [AC_MSG_RESULT([no])