Fix build break on gcc13 02/294302/1 tizen_dev accepted/tizen/unified/dev/20230726.115425 accepted/tizen/unified/x/20240627.090546
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>
Fri, 16 Jun 2023 01:38:10 +0000 (10:38 +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 b4996d54e06b238c586ee81bd80fe3afd9b4f710..d84938af0d6594abd4377317155d0d0b20b80eee 100644 (file)
@@ -13,6 +13,7 @@ License: BSD
 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