1 diff -ur libgpg-error.org/src/estream.c libgpg-error/src/estream.c
2 --- src/estream.c 2016-11-16 13:22:03.000000000 +0100
3 +++ src/estream.c~ 2017-02-19 17:53:15.010869000 +0100
9 +/*#include <sys/file.h>*/
26 #ifdef HAVE_W32_SYSTEM
28 +# define S_IRUSR _S_IREAD
31 +# define S_IWUSR _S_IWRITE
34 +# define S_IXUSR 0x00400000
37 # define S_IRGRP S_IRUSR
39 diff -ur libgpg-error.org/src/estream-printf.c libgpg-error/src/estream-printf.c
40 --- src/estream-printf.c 2016-12-02 22:51:19.000000000 +0100
41 +++ src/estream-printf.c~ 2017-02-19 18:02:52.239383500 +0100
55 --- src/Makefile.am 2017-02-28 13:33:38.000000000 +0100
56 +++ src/Makefile.am~ 2017-09-10 21:52:19.739988146 +0200
59 CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
61 - mkerrcodes mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
62 + mkerrcodes.exe mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
63 mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \
64 - gpg-extra/errno.h mkheader $(tmp_files) lock-obj-pub.native.h
65 + gpg-extra/errno.h mkheader.exe $(tmp_files) lock-obj-pub.native.h
71 # It is correct to use $(CC_FOR_BUILD) here. We want to run the
72 # program at build time.
73 -mkerrcodes: mkerrcodes.c mkerrcodes.h Makefile
74 +mkerrcodes.exe: mkerrcodes.c mkerrcodes.h Makefile
75 $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
79 $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c
82 -code-from-errno.h: mkerrcodes Makefile
83 +code-from-errno.h: mkerrcodes.exe Makefile
84 ./mkerrcodes | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
86 errnos-sym.h: Makefile mkstrtable.awk errnos.in
88 $(srcdir)/errnos.in >$@
91 -mkheader: mkheader.c Makefile
92 +mkheader.exe: mkheader.c Makefile
93 $(CC_FOR_BUILD) -g -O0 -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c
95 parts_of_gpg_error_h = \
98 # We also depend on versioninfo.rc because that is build by
99 # config.status and thus has up-to-date version numbers.
100 -gpg-error.h: Makefile mkheader $(parts_of_gpg_error_h) \
101 +gpg-error.h: Makefile mkheader.exe $(parts_of_gpg_error_h) \
102 versioninfo.rc ../config.h
104 ./mkheader $(host_os) $(host_triplet) $(srcdir)/gpg-error.h.in \
105 diff -ru libgpg-error.orig/src/Makefile.in libgpg-error/src/Makefile.in
106 --- src/Makefile.in 2017-02-28 15:03:41.000000000 +0100
107 +++ src/Makefile.in~ 2017-09-10 21:53:48.447987149 +0200
109 tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h mkw32errmap.map.c
110 CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
111 gpg-error.h gpgrt.h \
112 - mkerrcodes mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
113 + mkerrcodes.exe mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
114 mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \
115 - gpg-extra/errno.h mkheader $(tmp_files) lock-obj-pub.native.h
116 + gpg-extra/errno.h mkheader.exe $(tmp_files) lock-obj-pub.native.h
120 @@ -1309,7 +1309,7 @@
122 # It is correct to use $(CC_FOR_BUILD) here. We want to run the
123 # program at build time.
124 -mkerrcodes: mkerrcodes.c mkerrcodes.h Makefile
125 +mkerrcodes.exe: mkerrcodes.c mkerrcodes.h Makefile
126 $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
128 # It is correct to use $(CC_FOR_BUILD) here. We want to run the
129 @@ -1317,7 +1317,7 @@
130 @HAVE_W32CE_SYSTEM_TRUE@mkw32errmap: mkw32errmap.c mkw32errmap.tab.h Makefile
131 @HAVE_W32CE_SYSTEM_TRUE@ $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c
133 -code-from-errno.h: mkerrcodes Makefile
134 +code-from-errno.h: mkerrcodes.exe Makefile
135 ./mkerrcodes | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
137 errnos-sym.h: Makefile mkstrtable.awk errnos.in
138 @@ -1325,7 +1325,7 @@
139 -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
140 $(srcdir)/errnos.in >$@
142 -mkheader: mkheader.c Makefile
143 +mkheader.exe: mkheader.c Makefile
144 $(CC_FOR_BUILD) -g -O0 -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c
146 @FORCE_USE_SYSCFG_FALSE@./lock-obj-pub.native.h: Makefile gen-posix-lock-obj$(EXEEXT) posix-lock-obj.h
147 @@ -1333,7 +1333,7 @@
149 # We also depend on versioninfo.rc because that is build by
150 # config.status and thus has up-to-date version numbers.
151 -gpg-error.h: Makefile mkheader $(parts_of_gpg_error_h) \
152 +gpg-error.h: Makefile mkheader.exe $(parts_of_gpg_error_h) \
153 versioninfo.rc ../config.h
155 ./mkheader $(host_os) $(host_triplet) $(srcdir)/gpg-error.h.in \
156 --- src/mkheader.c 2016-11-16 13:22:03.000000000 +0100
157 +++ src/mkheader.c~ 2017-02-19 17:35:32.172009000 +0100
166 +# include <unistd.h>
169 #define PGM "mkheader"
171 @@ -402,12 +406,20 @@
173 repl_flag = !!strchr (name, '&');
174 incfname = mk_include_name (name, repl_flag? host_triplet : NULL);
176 + rc = _access (incfname, 04);
178 rc = access (incfname, R_OK);
183 incfname = mk_include_name (name, host_os);
185 + rc = _access (incfname, 04);
187 rc = access (incfname, R_OK);
191 include_file (fname, lnr, name, outf);
192 diff -ur libgpg-error.org/src/w32-estream.c libgpg-error/src/w32-estream.c
193 --- src/w32-estream.c 2016-11-16 13:22:03.000000000 +0100
194 +++ src/w32-estream.c~ 2017-02-19 17:37:35.879037500 +0100
197 #include "gpgrt-int.h"
200 +/* no ssize_t in windows std headers, emulate for native build */
201 +typedef SSIZE_T ssize_t;
205 * In order to support es_poll on Windows, we create a proxy shim that
206 * we use as the estream I/O functions. This shim creates reader and