Wed Jan 4 12:44:59 2017 UTC ()
Fix build on SunOS platforms.


(fhajny)
diff -r1.3 -r1.4 pkgsrc/textproc/jo/Makefile
diff -r1.1 -r1.2 pkgsrc/textproc/jo/distinfo
diff -r0 -r1.1 pkgsrc/textproc/jo/patches/patch-json.c

cvs diff -r1.3 -r1.4 pkgsrc/textproc/jo/Makefile (expand / switch to unified diff)

--- pkgsrc/textproc/jo/Makefile 2016/09/11 15:59:29 1.3
+++ pkgsrc/textproc/jo/Makefile 2017/01/04 12:44:59 1.4
@@ -1,15 +1,18 @@ @@ -1,15 +1,18 @@
1# $NetBSD: Makefile,v 1.3 2016/09/11 15:59:29 kamil Exp $ 1# $NetBSD: Makefile,v 1.4 2017/01/04 12:44:59 fhajny Exp $
2 2
3DISTNAME= jo-1.0 3DISTNAME= jo-1.0
4CATEGORIES= textproc 4CATEGORIES= textproc
5MASTER_SITES= ${MASTER_SITE_GITHUB:=jpmens/} 5MASTER_SITES= ${MASTER_SITE_GITHUB:=jpmens/}
6GITHUB_RELEASE= ${DISTNAME} 
7 6
8MAINTAINER= pkgsrc-users@NetBSD.org 7MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= https://github.com/jpmens/jo 8HOMEPAGE= https://github.com/jpmens/jo
10COMMENT= JSON output from a shell 9COMMENT= JSON output from a shell
11LICENSE= gnu-gpl-v2 10LICENSE= gnu-gpl-v2
12 11
 12GITHUB_RELEASE= ${DISTNAME}
 13
13GNU_CONFIGURE= yes 14GNU_CONFIGURE= yes
14 15
 16USE_LANGUAGES= c c99
 17
15.include "../../mk/bsd.pkg.mk" 18.include "../../mk/bsd.pkg.mk"

cvs diff -r1.1 -r1.2 pkgsrc/textproc/jo/distinfo (expand / switch to unified diff)

--- pkgsrc/textproc/jo/distinfo 2016/07/26 17:29:22 1.1
+++ pkgsrc/textproc/jo/distinfo 2017/01/04 12:44:59 1.2
@@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
1$NetBSD: distinfo,v 1.1 2016/07/26 17:29:22 kamil Exp $ 1$NetBSD: distinfo,v 1.2 2017/01/04 12:44:59 fhajny Exp $
2 2
3SHA1 (jo-1.0.tar.gz) = 2d06cf35b1dc71e5fdbe420ac4057cf508313e08 3SHA1 (jo-1.0.tar.gz) = 2d06cf35b1dc71e5fdbe420ac4057cf508313e08
4RMD160 (jo-1.0.tar.gz) = bff13c4e4689eb85a581e7383dc38d5cbd0052b5 4RMD160 (jo-1.0.tar.gz) = bff13c4e4689eb85a581e7383dc38d5cbd0052b5
5SHA512 (jo-1.0.tar.gz) = bab15de7a01e9a70f43b50d0bb5eff4724bf9d38b0b56a6fff5768756073a5956e3a5a08c7a4e4a2c88107950a4c1721a09b60868b10a441c1a4c6fec7748036 5SHA512 (jo-1.0.tar.gz) = bab15de7a01e9a70f43b50d0bb5eff4724bf9d38b0b56a6fff5768756073a5956e3a5a08c7a4e4a2c88107950a4c1721a09b60868b10a441c1a4c6fec7748036
6Size (jo-1.0.tar.gz) = 112488 bytes 6Size (jo-1.0.tar.gz) = 112488 bytes
 7SHA1 (patch-json.c) = 7ac3e1013c28c5b7b51c547e5417fdbfb13cd155

File Added: pkgsrc/textproc/jo/patches/Attic/patch-json.c
$NetBSD: patch-json.c,v 1.1 2017/01/04 12:44:59 fhajny Exp $

Backport a namespace conflict fix from trunk.

https://github.com/jpmens/jo/commit/2bedfd486f8f4a79b1865e370e6c858eb04257f5

--- json.c.orig	2016-03-10 10:49:34.000000000 +0000
+++ json.c
@@ -131,7 +131,7 @@ static void sb_free(SB *sb)
  * Type for Unicode codepoints.
  * We need our own because wchar_t might be 16 bits.
  */
-typedef uint32_t uchar_t;
+typedef uint32_t js_uchar_t;
 
 /*
  * Validate a single UTF-8 character starting at @s.
@@ -228,7 +228,7 @@ static bool utf8_validate(const char *s)
  * This function assumes input is valid UTF-8,
  * and that there are enough characters in front of @s.
  */
-static int utf8_read_char(const char *s, uchar_t *out)
+static int utf8_read_char(const char *s, js_uchar_t *out)
 {
 	const unsigned char *c = (const unsigned char*) s;
 	
@@ -240,21 +240,21 @@ static int utf8_read_char(const char *s,
 		return 1;
 	} else if (c[0] <= 0xDF) {
 		/* C2..DF (unless input is invalid) */
-		*out = ((uchar_t)c[0] & 0x1F) << 6 |
-		       ((uchar_t)c[1] & 0x3F);
+		*out = ((js_uchar_t)c[0] & 0x1F) << 6 |
+		       ((js_uchar_t)c[1] & 0x3F);
 		return 2;
 	} else if (c[0] <= 0xEF) {
 		/* E0..EF */
-		*out = ((uchar_t)c[0] &  0xF) << 12 |
-		       ((uchar_t)c[1] & 0x3F) << 6  |
-		       ((uchar_t)c[2] & 0x3F);
+		*out = ((js_uchar_t)c[0] &  0xF) << 12 |
+		       ((js_uchar_t)c[1] & 0x3F) << 6  |
+		       ((js_uchar_t)c[2] & 0x3F);
 		return 3;
 	} else {
 		/* F0..F4 (unless input is invalid) */
-		*out = ((uchar_t)c[0] &  0x7) << 18 |
-		       ((uchar_t)c[1] & 0x3F) << 12 |
-		       ((uchar_t)c[2] & 0x3F) << 6  |
-		       ((uchar_t)c[3] & 0x3F);
+		*out = ((js_uchar_t)c[0] &  0x7) << 18 |
+		       ((js_uchar_t)c[1] & 0x3F) << 12 |
+		       ((js_uchar_t)c[2] & 0x3F) << 6  |
+		       ((js_uchar_t)c[3] & 0x3F);
 		return 4;
 	}
 }
@@ -267,7 +267,7 @@ static int utf8_read_char(const char *s,
  *
  * This function will write up to 4 bytes to @out.
  */
-static int utf8_write_char(uchar_t unicode, char *out)
+static int utf8_write_char(js_uchar_t unicode, char *out)
 {
 	unsigned char *o = (unsigned char*) out;
 	
@@ -304,10 +304,10 @@ static int utf8_write_char(uchar_t unico
  * @uc should be 0xD800..0xDBFF, and @lc should be 0xDC00..0xDFFF.
  * If they aren't, this function returns false.
  */
-static bool from_surrogate_pair(uint16_t uc, uint16_t lc, uchar_t *unicode)
+static bool from_surrogate_pair(uint16_t uc, uint16_t lc, js_uchar_t *unicode)
 {
 	if (uc >= 0xD800 && uc <= 0xDBFF && lc >= 0xDC00 && lc <= 0xDFFF) {
-		*unicode = 0x10000 + ((((uchar_t)uc & 0x3FF) << 10) | (lc & 0x3FF));
+		*unicode = 0x10000 + ((((js_uchar_t)uc & 0x3FF) << 10) | (lc & 0x3FF));
 		return true;
 	} else {
 		return false;
@@ -319,9 +319,9 @@ static bool from_surrogate_pair(uint16_t
  *
  * @unicode must be U+10000..U+10FFFF.
  */
-static void to_surrogate_pair(uchar_t unicode, uint16_t *uc, uint16_t *lc)
+static void to_surrogate_pair(js_uchar_t unicode, uint16_t *uc, uint16_t *lc)
 {
-	uchar_t n;
+	js_uchar_t n;
 	
 	assert(unicode >= 0x10000 && unicode <= 0x10FFFF);
 	
@@ -844,7 +844,7 @@ bool parse_string(const char **sp, char
 				case 'u':
 				{
 					uint16_t uc, lc;
-					uchar_t unicode;
+					js_uchar_t unicode;
 					
 					if (!parse_hex16(&s, &uc))
 						goto failed;