cups-filters: Fix build with clang16/c++17

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2023-02-06 18:23:09 -08:00
parent 4f43546c02
commit 481467514e
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,36 @@
From 104fba23b1c0c67c92777b3165c6dca99558a656 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 6 Feb 2023 18:13:52 -0800
Subject: [PATCH] use noexcept(false) instead of throw() from c++17 onwards
C++17 removed dynamic exception specifications [1]
they had been deprecated since C++11, replace
throw(whatever) with noexcept(false).
[1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html
Upstream-Status: Submitted [https://github.com/OpenPrinting/cups-filters/pull/505]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
filter/pdftoraster.cxx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/filter/pdftoraster.cxx b/filter/pdftoraster.cxx
index e8af184fb..e91e22459 100755
--- a/filter/pdftoraster.cxx
+++ b/filter/pdftoraster.cxx
@@ -2148,7 +2148,11 @@ int main(int argc, char *argv[]) {
/* For compatibility with g++ >= 4.7 compilers _GLIBCXX_THROW
* should be used as a guard, otherwise use traditional definition */
#ifndef _GLIBCXX_THROW
+#if __cplusplus < 201703L
#define _GLIBCXX_THROW throw
+#else
+#define _GLIBCXX_THROW(x) noexcept(false)
+#endif
#endif
void * operator new(size_t size) _GLIBCXX_THROW (std::bad_alloc)
--
2.39.1

View File

@ -1,3 +1,4 @@
include cups-filters.inc
SRC_URI += "file://0001-use-noexcept-false-instead-of-throw-from-c-17-onward.patch"
SRC_URI[sha256sum] = "472418f1a1e12c9ad91b01caa020eb668626776d85de9da488be38e6663102ca"