diff mbox series

[meta-arago,kirkstone/master] libloki: fix C++ compile errors with gcc-11

Message ID 20230213192226.26228-1-afd@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,kirkstone/master] libloki: fix C++ compile errors with gcc-11 | expand

Commit Message

Andrew Davis Feb. 13, 2023, 7:22 p.m. UTC
Signed-off-by: Andrew Davis <afd@ti.com>
---
 ...llObj.h-ISO-C-17-does-not-allow-dyna.patch | 44 +++++++++++++++++++
 .../recipes-support/loki/libloki_0.1.7.bb     |  4 +-
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 meta-arago-extras/recipes-support/loki/libloki/0001-include-loki-SmallObj.h-ISO-C-17-does-not-allow-dyna.patch
diff mbox series

Patch

diff --git a/meta-arago-extras/recipes-support/loki/libloki/0001-include-loki-SmallObj.h-ISO-C-17-does-not-allow-dyna.patch b/meta-arago-extras/recipes-support/loki/libloki/0001-include-loki-SmallObj.h-ISO-C-17-does-not-allow-dyna.patch
new file mode 100644
index 00000000..96c487a4
--- /dev/null
+++ b/meta-arago-extras/recipes-support/loki/libloki/0001-include-loki-SmallObj.h-ISO-C-17-does-not-allow-dyna.patch
@@ -0,0 +1,44 @@ 
+From 9e36399573fd075d9607b3a89c4358dc18b065d7 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Mon, 13 Feb 2023 13:11:16 -0600
+Subject: [PATCH] include/loki/SmallObj.h: ISO C++17 does not allow dynamic
+ exception specifications
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+---
+ include/loki/SmallObj.h | 15 ++-------------
+ 1 file changed, 2 insertions(+), 13 deletions(-)
+
+diff --git a/include/loki/SmallObj.h b/include/loki/SmallObj.h
+index 65828bf..b5d1857 100644
+--- a/include/loki/SmallObj.h
++++ b/include/loki/SmallObj.h
+@@ -455,12 +455,7 @@ namespace Loki
+     public:
+ 
+         /// Throwing single-object new throws bad_alloc when allocation fails.
+-#ifdef _MSC_VER
+-        /// @note MSVC complains about non-empty exception specification lists.
+-        static void * operator new ( std::size_t size )
+-#else
+-        static void * operator new ( std::size_t size ) throw ( std::bad_alloc )
+-#endif
++        static void * operator new ( std::size_t size ) throw ()
+         {
+             typename MyThreadingModel::Lock lock;
+             (void)lock; // get rid of warning
+@@ -508,13 +503,7 @@ namespace Loki
+ #ifdef LOKI_SMALL_OBJECT_USE_NEW_ARRAY
+ 
+         /// Throwing array-object new throws bad_alloc when allocation fails.
+-#ifdef _MSC_VER
+-        /// @note MSVC complains about non-empty exception specification lists.
+-        static void * operator new [] ( std::size_t size )
+-#else
+-        static void * operator new [] ( std::size_t size )
+-            throw ( std::bad_alloc )
+-#endif
++        static void * operator new [] ( std::size_t size ) throw ()
+         {
+             typename MyThreadingModel::Lock lock;
+             (void)lock; // get rid of warning
diff --git a/meta-arago-extras/recipes-support/loki/libloki_0.1.7.bb b/meta-arago-extras/recipes-support/loki/libloki_0.1.7.bb
index 07aaa2f5..7eda512b 100644
--- a/meta-arago-extras/recipes-support/loki/libloki_0.1.7.bb
+++ b/meta-arago-extras/recipes-support/loki/libloki_0.1.7.bb
@@ -6,7 +6,9 @@  LIC_FILES_CHKSUM = "file://README;md5=5f7c1a2bebe34fc290234984d5845b03"
 
 SRC_URI = "http://libloki.sourcearchive.com/downloads/${PV}-3/${BPN}_${PV}.orig.tar.gz \
            file://0001-include-loki-Threads.h-return-statement-with-a-value.patch \
-           file://0002-test-Function-FunctionTest.cpp-reference-to-bad_func.patch"
+           file://0002-test-Function-FunctionTest.cpp-reference-to-bad_func.patch \
+           file://0001-include-loki-SmallObj.h-ISO-C-17-does-not-allow-dyna.patch \
+"
 
 SRC_URI[md5sum] = "af532c24a7f2e12d0829be8201934d92"
 SRC_URI[sha256sum] = "0c2094ce916b106731c8be61c32f538a22e1c0f8398bd5d6295b13d08e0c41a3"