diff options
author | Karl Berry <karl@freefriends.org> | 2018-01-09 18:53:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-01-09 18:53:05 +0000 |
commit | 9b0195121df2c53bdd030fdec6d7871f27f057f0 (patch) | |
tree | f58fc29c2856f942f64b30d91a1fc9247e1d5b10 /Build/source/texk/web2c | |
parent | 332064c92a01296b5dd2d25524d0f8286ccdd107 (diff) |
poppler 0.62.0, requiring C++11; luatex not updated yet
git-svn-id: svn://tug.org/texlive/trunk@46257 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r-- | Build/source/texk/web2c/Makefile.in | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/aclocal.m4 | 1 | ||||
-rw-r--r-- | Build/source/texk/web2c/c-auto.in | 3 | ||||
-rwxr-xr-x | Build/source/texk/web2c/configure | 994 | ||||
-rw-r--r-- | Build/source/texk/web2c/configure.ac | 17 | ||||
-rw-r--r-- | Build/source/texk/web2c/doc/Makefile.in | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/Makefile.in | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/man/Makefile.in | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegafonts/Makefile.in | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/otps/Makefile.in | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/otps/win32/Makefile.in | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/Makefile.in | 2 |
13 files changed, 1029 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in index 4d7c8156eae..c9d791eb27a 100644 --- a/Build/source/texk/web2c/Makefile.in +++ b/Build/source/texk/web2c/Makefile.in @@ -336,6 +336,7 @@ TESTS = tangle.test $(am__EXEEXT_41) ctiedir/ctie.test \ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ + $(top_srcdir)/../../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../../m4/kpse-asm.m4 \ $(top_srcdir)/../../m4/kpse-cairo-flags.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ @@ -1929,6 +1930,7 @@ GREP = @GREP@ HARFBUZZ_DEPEND = @HARFBUZZ_DEPEND@ HARFBUZZ_INCLUDES = @HARFBUZZ_INCLUDES@ HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HAVE_CXX11 = @HAVE_CXX11@ ICU_CONFIG = @ICU_CONFIG@ ICU_DEPEND = @ICU_DEPEND@ ICU_INCLUDES = @ICU_INCLUDES@ diff --git a/Build/source/texk/web2c/aclocal.m4 b/Build/source/texk/web2c/aclocal.m4 index 4ae7d7fbb1d..f7b20fa6765 100644 --- a/Build/source/texk/web2c/aclocal.m4 +++ b/Build/source/texk/web2c/aclocal.m4 @@ -1224,6 +1224,7 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/web2c-disable.m4]) +m4_include([../../m4/ax_cxx_compile_stdcxx.m4]) m4_include([../../m4/kpse-asm.m4]) m4_include([../../m4/kpse-cairo-flags.m4]) m4_include([../../m4/kpse-common.m4]) diff --git a/Build/source/texk/web2c/c-auto.in b/Build/source/texk/web2c/c-auto.in index ce18d89e49b..81d750ea7b8 100644 --- a/Build/source/texk/web2c/c-auto.in +++ b/Build/source/texk/web2c/c-auto.in @@ -55,6 +55,9 @@ /* Define to 1 if you have the `atoi' function. */ #undef HAVE_ATOI +/* define if the compiler supports basic C++11 syntax */ +#undef HAVE_CXX11 + /* Define to 1 if you have the declaration of `isascii', and to 0 if you don't. */ #undef HAVE_DECL_ISASCII diff --git a/Build/source/texk/web2c/configure b/Build/source/texk/web2c/configure index ee5a83d76ca..8d1af7c3052 100755 --- a/Build/source/texk/web2c/configure +++ b/Build/source/texk/web2c/configure @@ -823,6 +823,7 @@ MINGW32_TRUE WIN32_FALSE WIN32_TRUE KPSEWHICH +HAVE_CXX11 CXXLD WARNING_OBJCXXFLAGS am__fastdepOBJCXX_FALSE @@ -18975,6 +18976,999 @@ fi +if test "x$enable_xetex" = xyes \ + || test "x$enable_luatex" = xyes \ + || test "x$enable_luajittex" = xyes \ + || test "x$enable_luatex53" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: LuaTeX enabled" >&5 +$as_echo "$as_me: LuaTeX enabled" >&requiring C++11 support;} + 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' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 +$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } +if ${ax_cv_cxx_compile_cxx11+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template <typename T> + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check<void> single_type; + typedef check<check<void>> double_type; + typedef check<check<check<void>>> triple_type; + typedef check<check<check<check<void>>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same<T, T> + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same<int, decltype(0)>::value == true, ""); + static_assert(is_same<int, decltype(c)>::value == false, ""); + static_assert(is_same<int, decltype(v)>::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same<int, decltype(ac)>::value == true, ""); + static_assert(is_same<int, decltype(av)>::value == true, ""); + static_assert(is_same<int, decltype(sumi)>::value == true, ""); + static_assert(is_same<int, decltype(sumf)>::value == false, ""); + static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template <int...> + struct sum; + + template <int N0, int... N1toN> + struct sum<N0, N1toN...> + { + static constexpr auto value = N0 + sum<N1toN...>::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template<typename T> + using member = typename T::member_type; + + template<typename T> + void func(...) {} + + template<typename T> + void func(member<T>*) {} + + void test(); + + void test() { func<foo>(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_cxx_compile_cxx11=yes +else + ax_cv_cxx_compile_cxx11=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 +$as_echo "$ax_cv_cxx_compile_cxx11" >&6; } + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes + fi + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + 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 + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template <typename T> + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check<void> single_type; + typedef check<check<void>> double_type; + typedef check<check<check<void>>> triple_type; + typedef check<check<check<check<void>>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same<T, T> + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same<int, decltype(0)>::value == true, ""); + static_assert(is_same<int, decltype(c)>::value == false, ""); + static_assert(is_same<int, decltype(v)>::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same<int, decltype(ac)>::value == true, ""); + static_assert(is_same<int, decltype(av)>::value == true, ""); + static_assert(is_same<int, decltype(sumi)>::value == true, ""); + static_assert(is_same<int, decltype(sumf)>::value == false, ""); + static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template <int...> + struct sum; + + template <int N0, int... N1toN> + struct sum<N0, N1toN...> + { + static constexpr auto value = N0 + sum<N1toN...>::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template<typename T> + using member = typename T::member_type; + + template<typename T> + void func(...) {} + + template<typename T> + void func(member<T>*) {} + + void test(); + + void test() { func<foo>(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval $cachevar=yes +else + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi + + 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_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 + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template <typename T> + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check<void> single_type; + typedef check<check<void>> double_type; + typedef check<check<check<void>>> triple_type; + typedef check<check<check<check<void>>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same<T, T> + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same<int, decltype(0)>::value == true, ""); + static_assert(is_same<int, decltype(c)>::value == false, ""); + static_assert(is_same<int, decltype(v)>::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same<int, decltype(ac)>::value == true, ""); + static_assert(is_same<int, decltype(av)>::value == true, ""); + static_assert(is_same<int, decltype(sumi)>::value == true, ""); + static_assert(is_same<int, decltype(sumf)>::value == false, ""); + static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template <int...> + struct sum; + + template <int N0, int... N1toN> + struct sum<N0, N1toN...> + { + static constexpr auto value = N0 + sum<N1toN...>::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template<typename T> + using member = typename T::member_type; + + template<typename T> + void func(...) {} + + template<typename T> + void func(member<T>*) {} + + void test(); + + void test() { func<foo>(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval $cachevar=yes +else + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + 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++11 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + 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_CXX11=1 + +$as_echo "#define HAVE_CXX11 1" >>confdefs.h + + fi + + + +fi + if test "x$enable_texlive_build" = xyes; then : banner_pre='TeX Live' else diff --git a/Build/source/texk/web2c/configure.ac b/Build/source/texk/web2c/configure.ac index c6cd65893fe..f8c53aa34dc 100644 --- a/Build/source/texk/web2c/configure.ac +++ b/Build/source/texk/web2c/configure.ac @@ -1,6 +1,8 @@ +dnl $Id$ dnl Process this file with Autoconf to produce a configure script for Web2c. dnl -dnl Copyright (C) 2009-2015 Peter Breitenlohner <tex-live@tug.org> +dnl Copyright 2018 Karl Berry <tex-live@tug.org> +dnl Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org> dnl dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, @@ -15,9 +17,7 @@ dnl more than 256 fonts. dnl - NONASCII: necessary for the character translation feature. dnl - REGFIX: modern compilers mostly ignore register declarations, anyway. dnl The code for these things remains (where applicable), so you can -dnl get these features if you are willing to hack the sources. If not, -dnl it'll take a good argument to convince me to invest the time to make -dnl them configurable. +dnl get these features if you are willing to hack the sources. dnl m4_include([../../version.ac])[] dnl define tex_live_version AC_INIT([Web2C], tex_live_version(), [tex-k@tug.org]) @@ -46,6 +46,15 @@ dnl Include additional code for web2c. KPSE_WEB2C_PREPARE m4_include([ac/web2c.ac]) +dnl LuaTeX requires C++11 because poppler does :(. +if test "x$enable_xetex" = xyes \ + || test "x$enable_luatex" = xyes \ + || test "x$enable_luajittex" = xyes \ + || test "x$enable_luatex53" = xyes; then + AC_MSG_NOTICE(LuaTeX enabled, requiring C++11 support) + AX_CXX_COMPILE_STDCXX([11]) +fi + AS_IF([test "x$enable_texlive_build" = xyes], [banner_pre='TeX Live'], [banner_pre='Web2C']) diff --git a/Build/source/texk/web2c/doc/Makefile.in b/Build/source/texk/web2c/doc/Makefile.in index 7316008d687..a58e0209f15 100644 --- a/Build/source/texk/web2c/doc/Makefile.in +++ b/Build/source/texk/web2c/doc/Makefile.in @@ -90,6 +90,7 @@ host_triplet = @host@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ + $(top_srcdir)/../../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../../m4/kpse-asm.m4 \ $(top_srcdir)/../../m4/kpse-cairo-flags.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ @@ -283,6 +284,7 @@ GREP = @GREP@ HARFBUZZ_DEPEND = @HARFBUZZ_DEPEND@ HARFBUZZ_INCLUDES = @HARFBUZZ_INCLUDES@ HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HAVE_CXX11 = @HAVE_CXX11@ ICU_CONFIG = @ICU_CONFIG@ ICU_DEPEND = @ICU_DEPEND@ ICU_INCLUDES = @ICU_INCLUDES@ diff --git a/Build/source/texk/web2c/lib/Makefile.in b/Build/source/texk/web2c/lib/Makefile.in index bed496a53aa..f905551cff7 100644 --- a/Build/source/texk/web2c/lib/Makefile.in +++ b/Build/source/texk/web2c/lib/Makefile.in @@ -92,6 +92,7 @@ host_triplet = @host@ subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ + $(top_srcdir)/../../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../../m4/kpse-asm.m4 \ $(top_srcdir)/../../m4/kpse-cairo-flags.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ @@ -279,6 +280,7 @@ GREP = @GREP@ HARFBUZZ_DEPEND = @HARFBUZZ_DEPEND@ HARFBUZZ_INCLUDES = @HARFBUZZ_INCLUDES@ HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HAVE_CXX11 = @HAVE_CXX11@ ICU_CONFIG = @ICU_CONFIG@ ICU_DEPEND = @ICU_DEPEND@ ICU_INCLUDES = @ICU_INCLUDES@ diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc b/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc index 9ad50c99aeb..8bdbcf16535 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc +++ b/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc @@ -634,7 +634,7 @@ static int scanner_scan(lua_State * L) int i; for (i=0;i<count;i++) { Object *val = new Object(); - arrayref->get(i, val); + *val = arrayref->get(i); if (val->isStream()) { ObjectList *rover = self->_streams; ObjectList *item = (ObjectList *)priv_xmalloc (sizeof(ObjectList)); @@ -944,7 +944,7 @@ LUALIB_API int luaopen_pdfscanner(lua_State * L) luaL_openlib(L, 0, scannerlib_meta, 0); lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); - luaL_register(L, NULL, scannerlib_m); + luaL_openlib(L, NULL, scannerlib_m, 0); luaL_register(L, "pdfscanner", scannerlib); return 1; } diff --git a/Build/source/texk/web2c/man/Makefile.in b/Build/source/texk/web2c/man/Makefile.in index 7ca61db103c..4bcb578714a 100644 --- a/Build/source/texk/web2c/man/Makefile.in +++ b/Build/source/texk/web2c/man/Makefile.in @@ -107,6 +107,7 @@ host_triplet = @host@ subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ + $(top_srcdir)/../../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../../m4/kpse-asm.m4 \ $(top_srcdir)/../../m4/kpse-cairo-flags.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ @@ -261,6 +262,7 @@ GREP = @GREP@ HARFBUZZ_DEPEND = @HARFBUZZ_DEPEND@ HARFBUZZ_INCLUDES = @HARFBUZZ_INCLUDES@ HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HAVE_CXX11 = @HAVE_CXX11@ ICU_CONFIG = @ICU_CONFIG@ ICU_DEPEND = @ICU_DEPEND@ ICU_INCLUDES = @ICU_INCLUDES@ diff --git a/Build/source/texk/web2c/omegafonts/Makefile.in b/Build/source/texk/web2c/omegafonts/Makefile.in index e369d0ded4d..4c03b3a9227 100644 --- a/Build/source/texk/web2c/omegafonts/Makefile.in +++ b/Build/source/texk/web2c/omegafonts/Makefile.in @@ -95,6 +95,7 @@ EXTRA_PROGRAMS = omfonts$(EXEEXT) subdir = omegafonts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ + $(top_srcdir)/../../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../../m4/kpse-asm.m4 \ $(top_srcdir)/../../m4/kpse-cairo-flags.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ @@ -505,6 +506,7 @@ GREP = @GREP@ HARFBUZZ_DEPEND = @HARFBUZZ_DEPEND@ HARFBUZZ_INCLUDES = @HARFBUZZ_INCLUDES@ HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HAVE_CXX11 = @HAVE_CXX11@ ICU_CONFIG = @ICU_CONFIG@ ICU_DEPEND = @ICU_DEPEND@ ICU_INCLUDES = @ICU_INCLUDES@ diff --git a/Build/source/texk/web2c/otps/Makefile.in b/Build/source/texk/web2c/otps/Makefile.in index fcb8085b054..f9dc26db66f 100644 --- a/Build/source/texk/web2c/otps/Makefile.in +++ b/Build/source/texk/web2c/otps/Makefile.in @@ -95,6 +95,7 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) subdir = otps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ + $(top_srcdir)/../../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../../m4/kpse-asm.m4 \ $(top_srcdir)/../../m4/kpse-cairo-flags.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ @@ -545,6 +546,7 @@ GREP = @GREP@ HARFBUZZ_DEPEND = @HARFBUZZ_DEPEND@ HARFBUZZ_INCLUDES = @HARFBUZZ_INCLUDES@ HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HAVE_CXX11 = @HAVE_CXX11@ ICU_CONFIG = @ICU_CONFIG@ ICU_DEPEND = @ICU_DEPEND@ ICU_INCLUDES = @ICU_INCLUDES@ diff --git a/Build/source/texk/web2c/otps/win32/Makefile.in b/Build/source/texk/web2c/otps/win32/Makefile.in index 846384909d1..de340f943c7 100644 --- a/Build/source/texk/web2c/otps/win32/Makefile.in +++ b/Build/source/texk/web2c/otps/win32/Makefile.in @@ -92,6 +92,7 @@ bin_PROGRAMS = mkocp$(EXEEXT) mkofm$(EXEEXT) subdir = otps/win32 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ + $(top_srcdir)/../../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../../m4/kpse-asm.m4 \ $(top_srcdir)/../../m4/kpse-cairo-flags.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ @@ -267,6 +268,7 @@ GREP = @GREP@ HARFBUZZ_DEPEND = @HARFBUZZ_DEPEND@ HARFBUZZ_INCLUDES = @HARFBUZZ_INCLUDES@ HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HAVE_CXX11 = @HAVE_CXX11@ ICU_CONFIG = @ICU_CONFIG@ ICU_DEPEND = @ICU_DEPEND@ ICU_INCLUDES = @ICU_INCLUDES@ diff --git a/Build/source/texk/web2c/window/Makefile.in b/Build/source/texk/web2c/window/Makefile.in index 725182562f7..6948342d06e 100644 --- a/Build/source/texk/web2c/window/Makefile.in +++ b/Build/source/texk/web2c/window/Makefile.in @@ -92,6 +92,7 @@ host_triplet = @host@ subdir = window ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \ + $(top_srcdir)/../../m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/../../m4/kpse-asm.m4 \ $(top_srcdir)/../../m4/kpse-cairo-flags.m4 \ $(top_srcdir)/../../m4/kpse-common.m4 \ @@ -277,6 +278,7 @@ GREP = @GREP@ HARFBUZZ_DEPEND = @HARFBUZZ_DEPEND@ HARFBUZZ_INCLUDES = @HARFBUZZ_INCLUDES@ HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HAVE_CXX11 = @HAVE_CXX11@ ICU_CONFIG = @ICU_CONFIG@ ICU_DEPEND = @ICU_DEPEND@ ICU_INCLUDES = @ICU_INCLUDES@ |