diff options
Diffstat (limited to 'dev-util/cpputest/files/cpputest-4.0-autoconf.patch')
| -rw-r--r-- | dev-util/cpputest/files/cpputest-4.0-autoconf.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/dev-util/cpputest/files/cpputest-4.0-autoconf.patch b/dev-util/cpputest/files/cpputest-4.0-autoconf.patch new file mode 100644 index 000000000000..fe171d7a5582 --- /dev/null +++ b/dev-util/cpputest/files/cpputest-4.0-autoconf.patch @@ -0,0 +1,46 @@ +patch submitted to upstream at https://github.com/cpputest/cpputest/pull/1837 + +From 2ba7e10e73a1daf7194b83e952df58ce1c985644 Mon Sep 17 00:00:00 2001 +From: "Z. Liu" <zhixu.liu@gmail.com> +Date: Sun, 12 Jan 2025 23:04:59 +0800 +Subject: [PATCH] configure.ac: fix call of AC_LANG_PROGRAM & unexpected + compilation errors + +1. multiple line should be enclosed by [[ ]], otherwise compilation of + conftest.cpp will failed with: + error: extra tokens at end of #include directive [-Werror,-Wextra-tokens] +2. add #include <cstdint> +3. size_t -> std::size_t + +Signed-off-by: Z. Liu <zhixu.liu@gmail.com> +--- + configure.ac | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b19c9eb6..e91c4a27 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -325,13 +325,17 @@ AC_LANG_PUSH([C++]) + # Can we use operator delete without exception handling specifier? (clang warns on this!) + CXXFLAGS="-Werror" + AC_MSG_CHECKING([whether CXX supports operator delete without exception handling specifier]) +-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <new>\nvoid operator delete(void* mem);])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); UT_DELETE_MUST_HAVE_EXCEPTION_SPECIFIER="yes"]) ++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cstdint> ++#include <new> ++void operator delete(void* mem);]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); UT_DELETE_MUST_HAVE_EXCEPTION_SPECIFIER="yes"]) + CXXFLAGS="$saved_cxxflags" + + # Can we use operator new with exception specifier (g++4.7 on MacOSX is broken here) + CXXFLAGS="-Werror" + AC_MSG_CHECKING([whether CXX supports operator new with exception handling specifier]) +-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <new>\nvoid* operator new(size_t size) throw(std::bad_alloc);;])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); UT_NEW_CANT_HAVE_EXCEPTION_SPECIFIER="yes"]) ++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cstdint> ++#include <new> ++void* operator new(std::size_t size) throw(std::bad_alloc);;]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); UT_NEW_CANT_HAVE_EXCEPTION_SPECIFIER="yes"]) + CXXFLAGS="$saved_cxxflags" + + # Flag -Wno-missing-exception-spec +-- +2.45.2 + |
