Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / external / libgpg-error / w32-build-fixes.patch
blob1de57e4240890275755125d4c6aa52a20ecb82c6
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
4 @@ -74,12 +74,16 @@
5 # include <sys/time.h>
6 #endif
7 #include <sys/types.h>
8 -#include <sys/file.h>
9 +/*#include <sys/file.h>*/
10 #include <sys/stat.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 -#include <unistd.h>
15 +#ifdef _WIN32
16 +# include <io.h>
17 +#else
18 +# include <unistd.h>
19 +#endif
20 #include <stdarg.h>
21 #include <fcntl.h>
22 #include <errno.h>
23 @@ -109,6 +113,15 @@
26 #ifdef HAVE_W32_SYSTEM
27 +# ifndef S_IRUSR
28 +# define S_IRUSR _S_IREAD
29 +# endif
30 +# ifndef S_IWUSR
31 +# define S_IWUSR _S_IWRITE
32 +# endif
33 +# ifndef S_IXUSR
34 +# define S_IXUSR 0x00400000
35 +# endif
36 # ifndef S_IRGRP
37 # define S_IRGRP S_IRUSR
38 # endif
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
42 @@ -85,7 +85,11 @@
43 #include <stdio.h>
44 #include <stdlib.h>
45 #include <string.h>
46 -#include <unistd.h>
47 +#ifdef _WIN32
48 +# include <io.h>
49 +#else
50 +# include <unistd.h>
51 +#endif
52 #include <stdarg.h>
53 #include <errno.h>
54 #include <stddef.h>
55 --- src/mkheader.c 2016-11-16 13:22:03.000000000 +0100
56 +++ src/mkheader.c~ 2017-02-19 17:35:32.172009000 +0100
57 @@ -16,7 +16,11 @@
58 #include <stdlib.h>
59 #include <string.h>
60 #include <errno.h>
61 -#include <unistd.h>
62 +#ifdef _WIN32
63 +# include <io.h>
64 +#else
65 +# include <unistd.h>
66 +#endif
68 #define PGM "mkheader"
70 @@ -402,12 +406,20 @@
72 repl_flag = !!strchr (name, '&');
73 incfname = mk_include_name (name, repl_flag? host_triplet : NULL);
74 +#ifdef _WIN32
75 + rc = _access (incfname, 04);
76 +#else
77 rc = access (incfname, R_OK);
78 +#endif
79 if (rc && repl_flag)
81 free (incfname);
82 incfname = mk_include_name (name, host_os);
83 +#ifdef _WIN32
84 + rc = _access (incfname, 04);
85 +#else
86 rc = access (incfname, R_OK);
87 +#endif
89 if (!rc)
90 include_file (fname, lnr, name, outf);
91 diff -ur libgpg-error.org/src/w32-estream.c libgpg-error/src/w32-estream.c
92 --- src/w32-estream.c 2016-11-16 13:22:03.000000000 +0100
93 +++ src/w32-estream.c~ 2017-02-19 17:37:35.879037500 +0100
94 @@ -42,6 +42,11 @@
96 #include "gpgrt-int.h"
98 +#ifdef _WIN32
99 +/* no ssize_t in windows std headers, emulate for native build */
100 +typedef SSIZE_T ssize_t;
101 +#endif
104 * In order to support es_poll on Windows, we create a proxy shim that
105 * we use as the estream I/O functions. This shim creates reader and
106 --- src/spawn-w32.c 2019-08-22 12:30:38.000000000 +0200
107 +++ src/spawn-w32.c~ 2020-05-26 01:37:17.759077700 +0200
108 @@ -34,7 +34,11 @@
109 #ifdef HAVE_SIGNAL_H
110 # include <signal.h>
111 #endif
112 -#include <unistd.h>
113 +#ifdef _WIN32
114 +# include <io.h>
115 +#else
116 +# include <unistd.h>
117 +#endif
118 #include <fcntl.h>
119 #ifdef HAVE_STAT
120 # include <sys/stat.h>