Skip to content

Commit

Permalink
rapidjson: Add patches for compatibility with new GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
nanonyme committed Sep 19, 2024
1 parent 6329ebd commit 0d6161e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ modules:
- type: archive
url: https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz
sha256: bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
- type: patch
paths:
- patches/rapidjson/3b2441b87f99ab65f37b141a7b548ebadb607b96.patch
- patches/rapidjson/862c39be371278a45a88d4d1d75164be57bb7e2d.patch

- name: discord-rpc
buildsystem: cmake-ninja
Expand Down
22 changes: 22 additions & 0 deletions patches/rapidjson/3b2441b87f99ab65f37b141a7b548ebadb607b96.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 3b2441b87f99ab65f37b141a7b548ebadb607b96 Mon Sep 17 00:00:00 2001
From: Janusz Chorko <[email protected]>
Date: Fri, 26 Aug 2016 21:17:38 +0200
Subject: [PATCH] Removed non-compiling assignment operator. Fixed #718

---
include/rapidjson/document.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index e3e20dfbd..b0f1f70be 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -316,8 +316,6 @@ struct GenericStringRef {

GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {}

- GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
-
//! implicit conversion to plain CharType pointer
operator const Ch *() const { return s; }

22 changes: 22 additions & 0 deletions patches/rapidjson/862c39be371278a45a88d4d1d75164be57bb7e2d.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 862c39be371278a45a88d4d1d75164be57bb7e2d Mon Sep 17 00:00:00 2001
From: Janusz Chorko <[email protected]>
Date: Fri, 26 Aug 2016 21:26:50 +0200
Subject: [PATCH] Explicitly disable copy assignment operator

---
include/rapidjson/document.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index b0f1f70be..19f5a6a5f 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -326,6 +326,8 @@ struct GenericStringRef {
//! Disallow construction from non-const array
template<SizeType N>
GenericStringRef(CharType (&str)[N]) /* = delete */;
+ //! Copy assignment operator not permitted - immutable type
+ GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */;
};

//! Mark a character pointer as constant string

0 comments on commit 0d6161e

Please sign in to comment.