summaryrefslogtreecommitdiffstats
path: root/external/gpgmepp/w32-build-fixes.patch.1
blob: 01ea99d91e435c6972a7bb846efa9dfba3d91f34 (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
diff -ru gpgme.orig/m4/ax_cxx_compile_stdcxx.m4 gpgme/m4/ax_cxx_compile_stdcxx.m4
--- gpgme.orig/m4/ax_cxx_compile_stdcxx.m4	2016-05-27 22:04:36.000000000 +0200
+++ gpgme/m4/ax_cxx_compile_stdcxx.m4	2017-09-29 17:34:49.795243600 +0200
@@ -156,7 +156,7 @@
 
 #error "This is not a C++ compiler"
 
-#elif __cplusplus < 201103L
+#elif __cplusplus < 201103L && !(defined _MSC_VER)
 
 #error "This is not a C++11 compiler"
 
diff -ru gpgme.orig/src/dirinfo.c gpgme/src/dirinfo.c
--- gpgme.orig/src/dirinfo.c	2017-03-21 11:09:41.000000000 +0100
+++ gpgme/src/dirinfo.c	2017-09-30 08:36:13.239279300 +0200
@@ -33,6 +33,10 @@
 
 DEFINE_STATIC_LOCK (dirinfo_lock);
 
+#ifndef F_OK
+#define F_OK 0
+#endif
+
 /* Constants used internally to select the data.  */
 enum
   {
diff -ru gpgme.orig/src/mbox-util.c gpgme/src/mbox-util.c
--- gpgme.orig/src/mbox-util.c	2016-11-16 13:22:41.000000000 +0100
+++ gpgme/src/mbox-util.c	2017-09-30 08:18:29.270567500 +0200
@@ -28,7 +28,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <errno.h>
 
 #include "mbox-util.h"
diff -ru gpgme.orig/src/priv-io.h gpgme/src/priv-io.h
--- gpgme.orig/src/priv-io.h	2016-11-16 13:23:14.000000000 +0100
+++ gpgme/src/priv-io.h	2017-09-30 08:20:38.770562400 +0200
@@ -36,6 +36,9 @@
 #ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
+#if _MSC_VER
+typedef int pid_t;
+#endif
 
 
 /* A single file descriptor passed to spawn.  For child fds, dup_to
diff -ru gpgme.orig/src/util.h gpgme/src/util.h
--- gpgme.orig/src/util.h	2017-03-28 11:41:30.000000000 +0200
+++ gpgme/src/util.h	2017-09-30 08:10:54.194049100 +0200
@@ -39,6 +39,9 @@
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
 
 #include "gpgme.h"
 
diff -ru gpgme.orig/src/w32-util.c gpgme/src/w32-util.c
--- gpgme.orig/src/w32-util.c	2017-03-09 09:01:10.000000000 +0100
+++ gpgme/src/w32-util.c	2017-09-30 08:32:02.114330500 +0200
@@ -721,7 +721,8 @@
       v /= 62;
       XXXXXX[5] = letters[v % 62];
 
-      fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+      //fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+      fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL);
       if (fd >= 0)
 	{
 	  gpg_err_set_errno (save_errno);
diff -ru gpgme.orig/src/Makefile.am gpgme/src/Makefile.am
--- gpgme.orig/src/Makefile.am	2017-09-30 11:50:07.456960000 +0200
+++ gpgme/src/Makefile.am	2017-09-30 11:51:29.609649400 +0200
@@ -26,7 +26,7 @@
 m4data_DATA = gpgme.m4
 nodist_include_HEADERS = gpgme.h
 
-bin_PROGRAMS = gpgme-tool gpgme-json
+bin_PROGRAMS =
 
 if BUILD_W32_GLIB
 ltlib_gpgme_glib = libgpgme-glib.la
@@ -99,11 +99,11 @@
 # versions, because then every object file is only compiled once.
 AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GPG_ERROR_CFLAGS@ @GLIB_CFLAGS@
 
-gpgme_tool_SOURCES = gpgme-tool.c argparse.c argparse.h
-gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@
+gpgme_tool_SOURCES =
+gpgme_tool_LDADD =
 
-gpgme_json_SOURCES = gpgme-json.c cJSON.c cJSON.h
-gpgme_json_LDADD = -lm libgpgme.la $(GPG_ERROR_LIBS)
+gpgme_json_SOURCES =
+gpgme_json_LDADD =
 
 
 if HAVE_W32_SYSTEM
@@ -120,7 +120,7 @@
 SUFFIXES = .rc .lo
 
 .rc.lo:
-	$(LTRCCOMPILE) -i "$<" -o "$@"
+	$(LTRCCOMPILE) -i $< -o $@
 
 gpgme_res = versioninfo.lo
 no_undefined = -no-undefined
diff -ru gpgme.orig/src/vfs-mount.c gpgme/src/vfs-mount.c
--- gpgme.orig/src/vfs-mount.c	2017-03-09 09:01:10.000000000 +0100
+++ gpgme/src/vfs-mount.c	2017-09-30 13:10:51.845807600 +0200
@@ -68,7 +68,7 @@
   if (err)
     return err;
 
-  if (! strcasecmp ("MOUNTPOINT", code))
+  if (! _stricmp ("MOUNTPOINT", code))
     {
       if (opd->result.mount_dir)
 	free (opd->result.mount_dir);
diff -ur gpgmepp.org/src/w32-glib-io.c gpgmepp/src/w32-glib-io.c
--- gpgmepp.org/src/w32-glib-io.c	2016-11-16 13:22:41.000000000 +0100
+++ gpgmepp/src/w32-glib-io.c	2017-11-20 06:40:44.793945300 +0100
@@ -37,6 +37,7 @@
 #ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
+#include <winsock2.h>
 #include <glib.h>
 #include <windows.h>
 #include <io.h>