summaryrefslogtreecommitdiff
path: root/dev-util/cpputest/files/cpputest-4.0-autoconf.patch
diff options
context:
space:
mode:
authorZ. Liu <zhixu.liu@gmail.com>2025-01-12 23:37:00 +0800
committerSam James <sam@gentoo.org>2025-01-14 07:01:50 +0000
commit08bcbb8fa872ebfe830f17b8c89bdbaa01d1bc21 (patch)
tree3b2c45b26d386efeb599fdad577e513f9406aee3 /dev-util/cpputest/files/cpputest-4.0-autoconf.patch
parent11455cb3e18d922ef248d1965b4090897431012d (diff)
downloadgentoo-08bcbb8fa872ebfe830f17b8c89bdbaa01d1bc21.tar.gz
gentoo-08bcbb8fa872ebfe830f17b8c89bdbaa01d1bc21.tar.bz2
gentoo-08bcbb8fa872ebfe830f17b8c89bdbaa01d1bc21.zip
dev-util/cpputest: fix configure & test
1. fix unexpected errors during configuration, patch submitted to upstream at https://github.com/cpputest/cpputest/pull/1837 2. adopt patch from https://github.com/cpputest/cpputest/pull/1679, fix tests hangs w/ clang Closes: https://bugs.gentoo.org/879681 Closes: https://bugs.gentoo.org/924958 Signed-off-by: Z. Liu <zhixu.liu@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/40105 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/cpputest/files/cpputest-4.0-autoconf.patch')
-rw-r--r--dev-util/cpputest/files/cpputest-4.0-autoconf.patch46
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
+