Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
37555482
Commit
37555482
authored
Dec 08, 2016
by
Francis Dupont
Browse files
[5066] Simplified the C++11 for loop
parent
818d58d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
37555482
...
...
@@ -118,28 +118,30 @@ AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
# Check for std::unique_ptr and aggregate initialization (aka C++11) support
retried=0
CXX_SAVED=$CXX
for retry in "--std=c++11" "--std=c++0x" "--std=c++1x"; do
feature=
for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
if test "$retry" = "fail"; then
AC_MSG_ERROR([$feature (a C++11 feature) is not supported])
fi
if test "$retry" != "none"; then
AC_MSG_WARN([unsupported C++11 feature])
AC_MSG_NOTICE([retrying by adding $retry to $CXX])
CXX="$CXX_SAVED $retry"
fi
AC_MSG_CHECKING(std::unique_ptr support)
feature="std::unique_ptr"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <memory>],
[std::unique_ptr<int> a;])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
if test $retried -eq 0; then
AC_MSG_WARN([unsupported C++11 feature])
fi
if test $retried -ge 3; then
AC_MSG_ERROR([std::unique_ptr (a C++11 feature) is not supported])
fi
AC_MSG_NOTICE([retrying by adding $retry to $CXX])
retried=`expr $retried + 1`
CXX="$CXX_SAVED $retry"
continue])
AC_MSG_CHECKING(aggregate initialization support)
feature="aggregate initialization"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <vector>],
...
...
@@ -147,15 +149,6 @@ for retry in "--std=c++11" "--std=c++0x" "--std=c++1x"; do
[AC_MSG_RESULT([yes])
break],
[AC_MSG_RESULT([no])
if test $retried -eq 0; then
AC_MSG_WARN([unsupported C++11 feature])
fi
if test $retried -ge 3; then
AC_MSG_ERROR([aggregate initialization (a C++11 feature) is not supported])
fi
AC_MSG_NOTICE([retrying by adding $retry to $CXX])
retried=`expr $retried + 1`
CXX="$CXX_SAVED $retry"
continue])
done
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment