git: 6cbfd8b1e7dc - main - devel/cpprestsdk: Fix include of json.h
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 08 Jan 2024 17:53:29 UTC
The branch main has been updated by fernape:
URL: https://cgit.FreeBSD.org/ports/commit/?id=6cbfd8b1e7dc89a48a126867b180813df46c19e4
commit 6cbfd8b1e7dc89a48a126867b180813df46c19e4
Author: Jan-Espen Oversand <sigsegv@radiotube.org>
AuthorDate: 2024-01-08 08:33:05 +0000
Commit: Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2024-01-08 17:53:11 +0000
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
---
devel/cpprestsdk/Makefile | 1 +
devel/cpprestsdk/files/patch-include_cpprest_json.h | 20 ++++++++++++++++++++
devel/cpprestsdk/files/patch-src_json_json.cpp | 19 +++++++++++++++++++
3 files changed, 40 insertions(+)
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
++{
++}