From: Alex Rousskov Date: Tue, 16 Mar 2021 01:09:34 +0000 (+0000) Subject: Delete a few unnecessary checks for standard C++ features (#779) X-Git-Tag: 4.15-20210522-snapshot~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e6ceb8f5af3e7af2d4b08c64bdd56c83e5d1cd7;p=thirdparty%2Fsquid.git Delete a few unnecessary checks for standard C++ features (#779) * nullptr ought to be provided by any C++ compiler we support * HAVE_NULLPTR_T was unused while std::nullptr_t is used w/o it * HAVE_UNIQUE_PTR was almost unused while std::unique_ptr is used w/o it --- diff --git a/CREDITS b/CREDITS index 62efccbd48..90eefc9391 100644 --- a/CREDITS +++ b/CREDITS @@ -84,14 +84,6 @@ research project called The Harvest Information Discovery and Access System: ============================================================================== -acinclude/ax_cxx_0x_types.m4: - -## -## AX_CXX_TYPE_NULLPTR shamelessly copied from the DUNE sources under GPL version 2 -## - -============================================================================== - acinclude/ax_cxx_compile_stdcxx_11.m4: # Copyright (c) 2008 Benjamin Kosnik diff --git a/acinclude/ax_cxx_0x_types.m4 b/acinclude/ax_cxx_0x_types.m4 index 59d9017f3c..0110849b05 100644 --- a/acinclude/ax_cxx_0x_types.m4 +++ b/acinclude/ax_cxx_0x_types.m4 @@ -5,52 +5,6 @@ ## Please see the COPYING and CONTRIBUTORS files for details. ## -## -## AX_CXX_TYPE_NULLPTR shamelessly copied from the DUNE sources under GPL version 2 -## -AC_DEFUN([AX_CXX_TYPE_NULLPTR],[ - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH([C++]) - AC_MSG_CHECKING([whether nullptr is supported]) - AC_TRY_COMPILE([],[char* ch = nullptr;], [ - HAVE_NULLPTR=yes - AC_MSG_RESULT(yes)], [ - HAVE_NULLPTR=no - AC_MSG_RESULT(no)]) - if test "x$HAVE_NULLPTR" = xno; then - AC_DEFINE(nullptr, NULL, [Leave undefined if nullptr is supported]) - fi - AC_MSG_CHECKING([whether nullptr_t is supported]) - AC_TRY_COMPILE([#include ],[typedef nullptr_t peng;], [ - HAVE_NULLPTR_T=yes - AC_MSG_RESULT(yes)], [ - HAVE_NULLPTR_T=no - AC_MSG_RESULT(no)]) - if test "x$HAVE_NULLPTR_T" = xyes; then - AC_DEFINE(HAVE_NULLPTR_T, 1, [Define to 1 if nullptr_t is supported]) - fi - AC_LANG_POP -]) - -## Hand crafted for Squid under GPL version 2 -AC_DEFUN([AX_CXX_TYPE_UNIQUE_PTR],[ - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH([C++]) - AC_MSG_CHECKING([whether std::unique_ptr is supported]) - AC_TRY_COMPILE([#include ],[std::unique_ptr c;], [ - HAVE_UNIQUE_PTR=yes - AC_MSG_RESULT(yes)], [ - HAVE_UNIQUE_PTR=no - AC_MSG_RESULT(no)]) - if test "x$HAVE_UNIQUE_PTR" = xno; then - AC_DEFINE(unique_ptr, auto_ptr, [Leave undefined if std::unique_ptr is supported]) - fi - if test "x$HAVE_UNIQUE_PTR" = xyes; then - AC_DEFINE(HAVE_UNIQUE_PTR, 1, [Define to 1 if std::unique_ptr is supported]) - fi - AC_LANG_POP -]) - ## Hand crafted for Squid under GPL version 2 AC_DEFUN([AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS],[ AC_REQUIRE([AC_PROG_CXX]) diff --git a/compat/cppunit.h b/compat/cppunit.h index 2996c02af3..8475848e6b 100644 --- a/compat/cppunit.h +++ b/compat/cppunit.h @@ -12,7 +12,7 @@ // CPPUNIT test suite uses auto_ptr which is deprecated in C++0x #if HAVE_CPPUNIT_EXTENSIONS_HELPERMACROS_H -#if defined(__cplusplus) && HAVE_UNIQUE_PTR +#if defined(__cplusplus) #include #undef CPPUNIT_TEST_SUITE_END @@ -36,7 +36,7 @@ private: /* dummy typedef so that the macro can still end with ';'*/ \ typedef int CppUnitDummyTypedefForSemiColonEnding__ -#endif /* HAVE_UNIQUE_PTR */ +#endif /* __cplusplus */ #endif /* HAVE_CPPUNIT_EXTENSIONS_HELPERMACROS_H */ #endif /* SQUID_COMPAT_CPPUNIT_H */ diff --git a/configure.ac b/configure.ac index f24a62998f..f065149826 100644 --- a/configure.ac +++ b/configure.ac @@ -2895,8 +2895,6 @@ AC_CHECK_SIZEOF(off_t) AC_CHECK_SIZEOF(size_t) dnl Some C++11 types we try to use -AX_CXX_TYPE_NULLPTR -AX_CXX_TYPE_UNIQUE_PTR AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS SQUID_CXX_STD_UNDERLYING_TYPE