aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Espen Oversand <sigsegv@radiotube.org>2024-01-08 08:33:05 +0000
committerFernando ApesteguĂ­a <fernape@FreeBSD.org>2024-01-08 17:53:11 +0000
commit6cbfd8b1e7dc89a48a126867b180813df46c19e4 (patch)
tree2ba235771ddc0b7ab4edda9d9588a1cd4523c910
parent149e731cc8b6f0d36d43df17172b58673f8a835f (diff)
downloadports-6cbfd8b1e7dc89a48a126867b180813df46c19e4.tar.gz
ports-6cbfd8b1e7dc89a48a126867b180813df46c19e4.zip
devel/cpprestsdk: Fix include of json.h
De-inlining the constructor and destructor makes the sizeof(_Value) available to std::unique_ptr. PR: 276187 Reported by: sigsegv@radiotube.org
-rw-r--r--devel/cpprestsdk/Makefile1
-rw-r--r--devel/cpprestsdk/files/patch-include_cpprest_json.h20
-rw-r--r--devel/cpprestsdk/files/patch-src_json_json.cpp19
3 files changed, 40 insertions, 0 deletions
diff --git a/devel/cpprestsdk/Makefile b/devel/cpprestsdk/Makefile
index e93798effc69..f73e97728de1 100644
--- a/devel/cpprestsdk/Makefile
+++ b/devel/cpprestsdk/Makefile
@@ -1,5 +1,6 @@
PORTNAME= cpprestsdk
PORTVERSION= 2.10.18
+PORTREVISION= 1
DISTVERSIONPREFIX= v
CATEGORIES= devel
diff --git a/devel/cpprestsdk/files/patch-include_cpprest_json.h b/devel/cpprestsdk/files/patch-include_cpprest_json.h
new file mode 100644
index 000000000000..befe51ab04d4
--- /dev/null
+++ b/devel/cpprestsdk/files/patch-include_cpprest_json.h
@@ -0,0 +1,20 @@
+--- include/cpprest/json.h.orig 2023-12-05 04:23:31 UTC
++++ include/cpprest/json.h
+@@ -737,12 +737,13 @@ class value (private)
+ _ASYNCRTIMP void format(std::basic_string<char>& string) const;
+
+ #ifdef ENABLE_JSON_VALUE_VISUALIZER
+- explicit value(std::unique_ptr<details::_Value> v, value_type kind) : m_value(std::move(v)), m_kind(kind)
++ explicit value(std::unique_ptr<details::_Value> v, value_type kind);
+ #else
+- explicit value(std::unique_ptr<details::_Value> v) : m_value(std::move(v))
++ explicit value(std::unique_ptr<details::_Value> v);
+ #endif
+- {
+- }
++public:
++ ~value() noexcept;
++private:
+
+ std::unique_ptr<details::_Value> m_value;
+ #ifdef ENABLE_JSON_VALUE_VISUALIZER
diff --git a/devel/cpprestsdk/files/patch-src_json_json.cpp b/devel/cpprestsdk/files/patch-src_json_json.cpp
new file mode 100644
index 000000000000..2663b990b4a6
--- /dev/null
+++ b/devel/cpprestsdk/files/patch-src_json_json.cpp
@@ -0,0 +1,19 @@
+--- src/json/json.cpp.orig 2023-12-05 04:23:31 UTC
++++ src/json/json.cpp
+@@ -495,3 +495,16 @@ const web::json::details::json_error_category_impl& we
+ #endif
+ return instance;
+ }
++
++#ifdef ENABLE_JSON_VALUE_VISUALIZER
++web::json::value::value(std::unique_ptr<details::_Value> v, value_type kind) : m_value(std::move(v)
++), m_kind(kind)
++#else
++web::json::value::value(std::unique_ptr<details::_Value> v) : m_value(std::move(v))
++#endif
++{
++}
++
++web::json::value::~value() noexcept
++{
++}