summaryrefslogtreecommitdiff
path: root/external/libgpg-error/w32-build-fixes-5.patch
blob: 80d52f720e13bff6ffc4bed1331719afdb4c2a04 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
--- src/argparse.c	2021-11-03 13:44:56.000000000 +0100
+++ src/argparse.c~	2022-01-03 17:05:23.418077200 +0100
@@ -33,8 +33,12 @@
 #include <stdarg.h>
 #include <limits.h>
 #include <errno.h>
-#include <unistd.h>
 #include <time.h>
+#ifdef _WIN32
+# define R_OK 04
+# define strncasecmp _strnicmp
+# define strcasecmp _stricmp
+#endif
 
 #include "gpgrt-int.h"
 
--- src/gpg-error.c	2022-03-04 20:25:28.000000000 +0900
+++ src/gpg-error.c~	2023-08-30 15:10:24.521856169 +0900
@@ -61,6 +61,11 @@
 #define drop_locale_dir(dir)
 #endif
 
+#ifdef _WIN32
+# define strncasecmp _strnicmp
+# define strcasecmp _stricmp
+#endif
+
 static void
 i18n_init (void)
 {
--- src/spawn-w32.c	2023-08-30 15:24:46.861855840 +0900
+++ src/spawn-w32.c~	2023-08-30 15:26:04.581855810 +0900
@@ -56,7 +56,7 @@
  * Previous versions interpreted X_OK as F_OK anyway, so we'll just
  * use F_OK directly. */
 #undef X_OK
-#define X_OK F_OK
+#define X_OK 0
 
 /* For HANDLE and the internal file descriptor (fd) of this module:
  * HANDLE can be represented by an intptr_t which should be true for

--- src/logging.c	2023-03-21 18:33:56.000000000 +0900
+++ src/logging.c~	2023-08-30 15:37:20.661855553 +0900
@@ -44,7 +44,12 @@
 # include <netinet/in.h>
 # include <arpa/inet.h>
 #endif /*!HAVE_W32_SYSTEM*/
-#include <unistd.h>
+#ifdef _WIN32
+# include <io.h>
+# include <process.h>
+#else
+# include <unistd.h>
+#endif
 #include <fcntl.h>
 /* #include <execinfo.h> */
 
@@ -53,6 +58,15 @@
 
 
 #ifdef HAVE_W32_SYSTEM
+# ifndef  S_IRUSR
+#  define S_IRUSR _S_IREAD
+# endif
+# ifndef  S_IWUSR
+#  define S_IWUSR _S_IWRITE
+# endif
+# ifndef  S_IXUSR
+#  define S_IXUSR 0x00400000
+# endif
 # ifndef S_IRWXG
 #  define S_IRGRP S_IRUSR
 #  define S_IWGRP S_IWUSR
--- src/Makefile.am	2022-08-19 17:39:54.000000000 +0900
+++ src/Makefile.am~	2023-08-30 15:41:10.371855465 +0900
@@ -208,8 +208,8 @@
 # libgpg_error_la_DEPENDENCIES = \
 #        $(srcdir)/gpg-error.vers
 
-libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
-libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD)
+libgpg_error_la_CPPFLAGS = -DLOCALEDIR=$(localelidir)
+libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) -ladvapi32 $(LIBTHREAD)
 
 gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
 gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \
--- src/Makefile.in	2023-08-30 14:44:01.102310369 +0900
+++ src/Makefile.in~	2023-08-30 15:54:38.371855157 +0900
@@ -662,8 +662,8 @@
 
 # libgpg_error_la_DEPENDENCIES = \
 #        $(srcdir)/gpg-error.vers
-libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
-libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD)
+libgpg_error_la_CPPFLAGS = -DLOCALEDIR=$(localedir)
+libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) -ladvapi32 $(LIBTHREAD)
 gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
 gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \
                      -DLOCALEDIR=\"$(localedir)\"
--- src/sysutils.c	2023-03-21 18:33:56.000000000 +0900
+++ src/sysutils.c~	2023-08-30 15:57:34.401855090 +0900
@@ -22,7 +22,12 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
-#include <unistd.h>
+#ifdef _WIN32
+# include <io.h>
+# define W_OK 02
+#else
+# include <unistd.h>
+#endif
 #include <errno.h>
 #ifdef HAVE_W32_SYSTEM
 # include <windows.h>
--- src/visibility.c	2020-06-05 18:54:56.410442900 +0200
+++ src/visibility.c~	2019-01-04 12:56:54.000000000 +0100
@@ -1067,11 +1067,7 @@
 _gpgrt_log_assert (const char *expr, const char *file,
                    int line, const char *func)
 {
-#ifdef GPGRT_HAVE_MACRO_FUNCTION
   _gpgrt__log_assert (expr, file, line, func);
-#else
-  _gpgrt__log_assert (expr, file, line);
-#endif
 }
 
 
--- src/w32-add.h	2020-06-06 00:32:38.502203300 +0200
+++ src/w32-add.h~	2018-12-07 14:48:19.000000000 +0100
@@ -65,3 +65,5 @@
 char *gpgrt_w32_reg_query_string (const char *root,
                                   const char *dir,
                                   const char *name);
+
+wchar_t *utf8_to_wchar (const char *string, size_t length, size_t *retlen);
--- src/w32-gettext.c	2022-03-04 21:44:26.000000000 +0900
+++ src/w32-gettext.c~	2023-08-30 16:01:12.861855006 +0900
@@ -1325,7 +1325,7 @@
    is not defined.  If LENGTH is zero and RETLEN NULL the function
    assumes that STRING is a nul-terminated string and returns a
    (wchar_t)0-terminated string.  */
+wchar_t *
-static wchar_t *
 utf8_to_wchar (const char *string, size_t length, size_t *retlen)
 {
   int n;