Kaynağa Gözat

Only require C++11

Bryan Drewery 6 yıl önce
ebeveyn
işleme
a16c41cb3f
5 değiştirilmiş dosya ile 17 ekleme ve 137 silme
  1. 1 1
      build/autotools/configure.ac
  2. 12 132
      configure
  3. 1 1
      doc/UPDATES.md
  4. 1 1
      lib/bdlib
  5. 2 2
      src/config.h.in

+ 1 - 1
build/autotools/configure.ac

@@ -20,7 +20,7 @@ AC_PROG_CXX([clang++80 clang++70 clang++60 clang++50 clang++40 clang++39 clang++
 CC="${CXX} -x c"
 AC_SUBST(CC)
 AC_REQUIRE_CPP
-AX_CXX_COMPILE_STDCXX_14([noext], [mandatory])
+AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
 EGG_CHECK_CC
 #CXX_RPATH_CHECK
 

+ 12 - 132
configure

@@ -662,7 +662,7 @@ GCC3DEB
 GCC3_CXXFLAGS
 GCC3_CFLAGS
 CCDEPMODE
-HAVE_CXX14
+HAVE_CXX11
 CXXCPP
 CC
 OBJEXT
@@ -3146,7 +3146,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 
-  ax_cxx_compile_alternatives="14 1y"    ax_cxx_compile_cxx14_required=true
+  ax_cxx_compile_alternatives="11 0x"    ax_cxx_compile_cxx11_required=true
   ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3159,9 +3159,9 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     if test x$ac_success = xno; then
                 for alternative in ${ax_cxx_compile_alternatives}; do
       for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
-        cachevar=`$as_echo "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh`
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5
-$as_echo_n "checking whether $CXX supports C++14 features with $switch... " >&6; }
+        cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
+$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
 if eval \${$cachevar+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -3455,126 +3455,6 @@ namespace cxx11
 
 
 
-
-// If the compiler admits that it is not ready for C++14, why torture it?
-// Hopefully, this will speed up the test.
-
-#ifndef __cplusplus
-
-#error "This is not a C++ compiler"
-
-#elif __cplusplus < 201402L
-
-#error "This is not a C++14 compiler"
-
-#else
-
-namespace cxx14
-{
-
-  namespace test_polymorphic_lambdas
-  {
-
-    int
-    test()
-    {
-      const auto lambda = [](auto&&... args){
-        const auto istiny = [](auto x){
-          return (sizeof(x) == 1UL) ? 1 : 0;
-        };
-        const int aretiny[] = { istiny(args)... };
-        return aretiny[0];
-      };
-      return lambda(1, 1L, 1.0f, '1');
-    }
-
-  }
-
-  namespace test_binary_literals
-  {
-
-    constexpr auto ivii = 0b0000000000101010;
-    static_assert(ivii == 42, "wrong value");
-
-  }
-
-  namespace test_generalized_constexpr
-  {
-
-    template < typename CharT >
-    constexpr unsigned long
-    strlen_c(const CharT *const s) noexcept
-    {
-      auto length = 0UL;
-      for (auto p = s; *p; ++p)
-        ++length;
-      return length;
-    }
-
-    static_assert(strlen_c("") == 0UL, "");
-    static_assert(strlen_c("x") == 1UL, "");
-    static_assert(strlen_c("test") == 4UL, "");
-    static_assert(strlen_c("another\0test") == 7UL, "");
-
-  }
-
-  namespace test_lambda_init_capture
-  {
-
-    int
-    test()
-    {
-      auto x = 0;
-      const auto lambda1 = [a = x](int b){ return a + b; };
-      const auto lambda2 = [a = lambda1(x)](){ return a; };
-      return lambda2();
-    }
-
-  }
-
-  namespace test_digit_separators
-  {
-
-    constexpr auto ten_million = 100'000'000;
-    static_assert(ten_million == 100000000, "");
-
-  }
-
-  namespace test_return_type_deduction
-  {
-
-    auto f(int& x) { return x; }
-    decltype(auto) g(int& x) { return x; }
-
-    template < typename T1, typename T2 >
-    struct is_same
-    {
-      static constexpr auto value = false;
-    };
-
-    template < typename T >
-    struct is_same<T, T>
-    {
-      static constexpr auto value = true;
-    };
-
-    int
-    test()
-    {
-      auto x = 0;
-      static_assert(is_same<int, decltype(f(x))>::value, "");
-      static_assert(is_same<int&, decltype(g(x))>::value, "");
-      return x;
-    }
-
-  }
-
-}  // namespace cxx14
-
-#endif  // __cplusplus >= 201402L
-
-
-
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
   eval $cachevar=yes
@@ -3607,19 +3487,19 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-  if test x$ax_cxx_compile_cxx14_required = xtrue; then
+  if test x$ax_cxx_compile_cxx11_required = xtrue; then
     if test x$ac_success = xno; then
-      as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5
+      as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
     fi
   fi
   if test x$ac_success = xno; then
-    HAVE_CXX14=0
-    { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5
-$as_echo "$as_me: No compiler with C++14 support was found" >&6;}
+    HAVE_CXX11=0
+    { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
+$as_echo "$as_me: No compiler with C++11 support was found" >&6;}
   else
-    HAVE_CXX14=1
+    HAVE_CXX11=1
 
-$as_echo "#define HAVE_CXX14 1" >>build/confdefs.h
+$as_echo "#define HAVE_CXX11 1" >>build/confdefs.h
 
   fi
 

+ 1 - 1
doc/UPDATES.md

@@ -1,5 +1,5 @@
 # master
-  * Require C++14 compiler support (GCC 5+, Clang 3.4+)
+  * Require C++11 compiler support (GCC 48+, Clang 3.4+)
   * Wraith now automatically assigns roles to bots for channels, no longer
     requiring manually assigning them with flags +flry for flood, limit,
     resolve, auto-voice, auto-op. These roles are decentralized and per-chan

+ 1 - 1
lib/bdlib

@@ -1 +1 @@
-Subproject commit 16bf8c86491385f9baf615046d5c7d4e98903b0c
+Subproject commit be915279cdc3db602d7da1d3691a53b24bcf5654

+ 2 - 2
src/config.h.in

@@ -25,8 +25,8 @@
 /* Define to 1 if you have the `closefrom' function. */
 #undef HAVE_CLOSEFROM
 
-/* define if the compiler supports basic C++14 syntax */
-#undef HAVE_CXX14
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
 
 /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
    */