Skip to content

Commit

Permalink
Bug 1861753 - Patch RNP uniwin.h to handle changes in json-c 0.17. r=…
Browse files Browse the repository at this point in the history
…kaie

#define ssize_t conflicts with typedefs added in json-c 0.17.
Replace the defines with typedefs, these result in the same typedefs used
in json-c.

Patch has been submitted upstream: rnpgp/rnp#2145

Differential Revision: https://phabricator.services.mozilla.com/D193100

--HG--
extra : moz-landing-system : lando
  • Loading branch information
jfx2006 committed Nov 30, 2023
1 parent 6707a80 commit 4689b91
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
7 changes: 1 addition & 6 deletions third_party/README.rnp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,4 @@ is at rnp/moz.yaml.
> mach vendor ./moz.yaml --patch-mode none
# followed by
> mach vendor ./moz.yaml --patch-mode only


Build notes:




27 changes: 27 additions & 0 deletions third_party/patches/rnp/pr2145.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From d211911a54080b6dd551572c9a7cad5611bfa7bc Mon Sep 17 00:00:00 2001
From: Rob Lemley <[email protected]>
Date: Wed, 8 Nov 2023 11:23:13 -0500
Subject: [PATCH] Use typedef for Windows ssize_t. Fixes #2144.

---
src/common/uniwin.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/uniwin.h b/src/common/uniwin.h
index 095c325b..b7e2b52d 100644
--- a/src/common/uniwin.h
+++ b/src/common/uniwin.h
@@ -35,9 +35,9 @@
#include <direct.h> /* for _getcwd() and _chdir() */

#ifdef _WIN64
-#define ssize_t __int64
+typedef __int64 ssize_t;
#else
-#define ssize_t long
+typedef long ssize_t;
#endif

#define STDIN_FILENO 0
--
2.42.1
3 changes: 2 additions & 1 deletion third_party/rnp/moz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ origin:
url: "https://www.rnpgp.org/"
license: BSD-2-Clause

release: v0.17.0 (2023-05-02T08:01:48Z).
release: v0.17.0 (2023-05-02T11:01:48+03:00).

revision: v0.17.0

Expand Down Expand Up @@ -68,6 +68,7 @@ vendoring:

patches:
- ../patches/rnp/bug1843535_gcc13_missing_header.patch
- ../patches/rnp/pr2145.patch

update-actions:
- action: replace-in-file-regex
Expand Down
4 changes: 2 additions & 2 deletions third_party/rnp/src/common/uniwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
#include <direct.h> /* for _getcwd() and _chdir() */

#ifdef _WIN64
#define ssize_t __int64
typedef __int64 ssize_t;
#else
#define ssize_t long
typedef long ssize_t;
#endif

#define STDIN_FILENO 0
Expand Down

0 comments on commit 4689b91

Please sign in to comment.