Fix build break on gcc13 39/312839/1 accepted/tizen_9.0_unified accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_toolchain accepted/tizen_unified_x accepted/tizen_unified_x_asan tizen tizen_9.0 accepted/tizen/9.0/unified/20241030.235837 accepted/tizen/unified/20240627.103729 accepted/tizen/unified/dev/20240701.073057 accepted/tizen/unified/toolchain/20240812.130403 accepted/tizen/unified/x/20240628.013952 accepted/tizen/unified/x/asan/20240813.224726 tizen_9.0_m2_release
authorTae-Young Chung <ty83.chung@samsung.com>
Fri, 16 Jun 2023 01:32:31 +0000 (10:32 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Mon, 17 Jun 2024 03:37:26 +0000 (12:37 +0900)
This commit is cherry-picked from
upstream issue #332(https://github.com/google/glog/pull/332)
-----------------
From: NeroBurner <pyro4hell@gmail.com>
Date: Thu, 21 Jun 2018 14:02:46 +0200
Subject: tests: fix compilation with C++17

Remove throw() commands as they were deprecated with C++11 and are
removed with C++17
----------------

Change-Id: I11e58ebf28b03b48bd81ca26b685d8765560067b
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
packaging/0001-fix-build-break-on-tizen-gcc13.patch [new file with mode: 0644]
packaging/glog.spec

diff --git a/packaging/0001-fix-build-break-on-tizen-gcc13.patch b/packaging/0001-fix-build-break-on-tizen-gcc13.patch
new file mode 100644 (file)
index 0000000..d3cc4fd
--- /dev/null
@@ -0,0 +1,30 @@
+diff --git a/src/googletest.h b/src/googletest.h
+index 12ea454..bc20305 100644
+--- a/src/googletest.h
++++ b/src/googletest.h
+@@ -576,21 +576,21 @@ void (*g_new_hook)() = NULL;
+ _END_GOOGLE_NAMESPACE_
+-void* operator new(size_t size) throw(std::bad_alloc) {
++void* operator new(size_t size) {
+   if (GOOGLE_NAMESPACE::g_new_hook) {
+     GOOGLE_NAMESPACE::g_new_hook();
+   }
+   return malloc(size);
+ }
+-void* operator new[](size_t size) throw(std::bad_alloc) {
++void* operator new[](size_t size) {
+   return ::operator new(size);
+ }
+-void operator delete(void* p) throw() {
++void operator delete(void* p) {
+   free(p);
+ }
+-void operator delete[](void* p) throw() {
++void operator delete[](void* p) {
+   ::operator delete(p);
+ }
index bd869f4ef519499273ee096ff47b1327f7965413..60701ce1ab572d929c220e56963c2bf7515d8cfe 100644 (file)
@@ -13,6 +13,7 @@ License: BSD-3-Clause
 Vendor: Google
 Packager: Google Inc. <opensource@google.com>
 Source: %{name}-%{version}.tar.gz
+Patch0: 0001-fix-build-break-on-tizen-gcc13.patch
 Distribution: Redhat 7 and above.
 Prefix: %prefix
 
@@ -37,6 +38,8 @@ files for developing applications that use the %name package.
 %prep
 %setup
 
+%patch0 -p1
+
 %build
 %autogen.sh
 ./configure