Package: foo2zjs / 20200505dfsg0-1

0002-Fix-icc2ps-build.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Didier Raboud <odyx@debian.org>
Date: Tue, 4 Oct 2016 11:43:44 +0200
Subject: Fix icc2ps build

Include unistd.h to make sure the swab function is not implicitly declared,
also declare _XOPEN_SOURCE to have it available  through unistd.h, and
therefore declare _GNU_SOURCE to have  strcasecmp() and vsnprintf()
---
 icc2ps/Makefile | 4 ++++
 icc2ps/cmsio1.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/icc2ps/Makefile b/icc2ps/Makefile
index 215105b..0aa49ba 100644
--- a/icc2ps/Makefile
+++ b/icc2ps/Makefile
@@ -10,6 +10,10 @@ LIB=	cmscam97.c cmscnvrt.c cmserr.c cmsgamma.c cmsgmt.c cmsintrp.c cmsio1.c \
 	cmslut.c cmsmatsh.c cmsmtrx.c cmsnamed.c cmspack.c cmspcs.c cmsps2.c \
 	cmssamp.c cmswtpnt.c cmsxform.c cmsio0.c cmsvirt.c
 CFLAGS+=	-O3
+
+# _XOPEN_SOURCE is required for swab() but undefines strcasecmp(), so add _GNU_SOURCE as well:
+CFLAGS+= -D_XOPEN_SOURCE -D_GNU_SOURCE
+
 INSTALL=install
 ifeq ($(UNAME),SunOS)
     INSTALL=/usr/ucb/install
diff --git a/icc2ps/cmsio1.c b/icc2ps/cmsio1.c
index 1f02720..9f9d6e4 100644
--- a/icc2ps/cmsio1.c
+++ b/icc2ps/cmsio1.c
@@ -71,6 +71,7 @@ void xswab(const void *from, void *to, size_t len)
 #undef STEP
 }
 #else
+#include <unistd.h>
 #define xswab swab
 #endif