summaryrefslogtreecommitdiff
path: root/external/gpgmepp/w32-fix-win32-macro.patch.1
blob: 70a8b5ffe6e833e5a86844f9f07f0b7604c1636c (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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
diff -ur gpgmepp.org/lang/cpp/src/callbacks.cpp gpgmepp/lang/cpp/src/callbacks.cpp
--- gpgmepp.org/lang/cpp/src/callbacks.cpp	2016-10-18 19:22:02.000000000 +0200
+++ gpgmepp/lang/cpp/src/callbacks.cpp	2017-11-20 18:03:04.290060900 +0100
@@ -38,7 +38,9 @@
 #include <cassert>
 #include <cerrno>
 #include <cstring>
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <stdlib.h>
 
 static inline gpgme_error_t make_err_from_syserror()
diff -ur gpgmepp.org/lang/cpp/src/data.h gpgmepp/lang/cpp/src/data.h
--- gpgmepp.org/lang/cpp/src/data.h	2017-03-24 15:20:32.000000000 +0100
+++ gpgmepp/lang/cpp/src/data.h	2017-11-20 17:23:24.802711200 +0100
@@ -31,6 +31,11 @@
 #include <algorithm>
 #include <memory>
 
+#ifdef _MSC_VER
+#  include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#endif
+
 namespace GpgME
 {
 
diff -ur gpgmepp.org/lang/cpp/src/editinteractor.cpp gpgmepp/lang/cpp/src/editinteractor.cpp
--- gpgmepp.org/lang/cpp/src/editinteractor.cpp	2017-03-09 09:01:10.000000000 +0100
+++ gpgmepp/lang/cpp/src/editinteractor.cpp	2017-11-20 18:09:33.022674700 +0100
@@ -30,9 +30,11 @@
 
 #include <gpgme.h>
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 # include <io.h>
-#include <windows.h>
+# include <windows.h>
+# include <BaseTsd.h>
+  typedef SSIZE_T ssize_t;
 #else
 # include <unistd.h>
 #endif
diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_export.h
--- gpgmepp.org/lang/cpp/src/gpgmepp_export.h	2016-08-04 15:03:09.000000000 +0200
+++ gpgmepp/lang/cpp/src/gpgmepp_export.h	2017-11-20 16:57:47.805691100 +0100
@@ -29,14 +29,14 @@
 #  ifndef GPGMEPP_EXPORT
 #    ifdef BUILDING_GPGMEPP
         /* We are building this library */
-#      ifdef WIN32
+#      ifdef _MSC_VER
 #       define GPGMEPP_EXPORT __declspec(dllexport)
 #      else
 #       define GPGMEPP_EXPORT __attribute__((visibility("default")))
 #      endif
 #    else
         /* We are using this library */
-#      ifdef WIN32
+#      ifdef _MSC_VER
 #       define GPGMEPP_EXPORT __declspec(dllimport)
 #      else
 #       define GPGMEPP_EXPORT __attribute__((visibility("default")))
@@ -45,7 +45,7 @@
 #  endif
 
 #  ifndef GPGMEPP_NO_EXPORT
-#    ifdef WIN32
+#    ifdef _MSC_VER
 #     define GPGMEPP_NO_EXPORT
 #    else
 #     define GPGMEPP_NO_EXPORT __attribute__((visibility("hidden")))
@@ -54,7 +54,11 @@
 #endif
 
 #ifndef GPGMEPP_DEPRECATED
-#  define GPGMEPP_DEPRECATED __attribute__ ((__deprecated__))
+#  ifdef _MSC_VER
+#    define GPGMEPP_DEPRECATED __declspec(deprecated("deprecated"))
+#  else
+#    define GPGMEPP_DEPRECATED __attribute__ ((__deprecated__))
+#  endif
 #endif
 
 #ifndef GPGMEPP_DEPRECATED_EXPORT
diff -ur gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h gpgmepp/lang/cpp/src/interfaces/dataprovider.h
--- gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h	2016-05-17 14:32:37.000000000 +0200
+++ gpgmepp/lang/cpp/src/interfaces/dataprovider.h	2017-11-20 18:03:11.332715700 +0100
@@ -29,6 +29,11 @@
 
 #include <gpg-error.h>
 
+#ifdef _MSC_VER
+#  include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#endif
+
 namespace GpgME
 {
 
diff -ur gpgmepp.org/lang/cpp/src/key.cpp gpgmepp/lang/cpp/src/key.cpp
--- gpgmepp.org/lang/cpp/src/key.cpp	2017-03-20 20:10:15.000000000 +0100
+++ gpgmepp/lang/cpp/src/key.cpp	2017-11-20 17:44:50.321858800 +0100
@@ -33,10 +33,16 @@
 #include <gpgme.h>
 
 #include <string.h>
+#if HAVE_STRINGS_H
 #include <strings.h>
+#endif
 #include <istream>
 #include <iterator>
 
+#ifdef _MSC_VER
+#  define strcasecmp _stricmp
+#endif
+
 const GpgME::Key::Null GpgME::Key::null;
 
 namespace GpgME
diff -ur gpgmepp.org/lang/cpp/src/key.h gpgmepp/lang/cpp/src/key.h
--- gpgmepp.org/lang/cpp/src/key.h	2017-03-20 20:10:15.000000000 +0100
+++ gpgmepp/lang/cpp/src/key.h	2017-11-20 17:07:51.551632000 +0100
@@ -30,7 +30,6 @@
 #include "gpgmefw.h"
 
 #include <memory>
-#include <sys/time.h>
 
 #include <vector>
 #include <algorithm>
diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_export.h
--- gpgmepp.org/lang/qt/src/qgpgme_export.h	2016-11-03 17:32:30.000000000 +0100
+++ gpgmepp/lang/qt/src/qgpgme_export.h	2017-11-20 16:58:27.395388000 +0100
@@ -39,14 +39,14 @@
 #  ifndef QGPGME_EXPORT
 #    ifdef BUILDING_QGPGME
         /* We are building this library */
-#      ifdef WIN32
+#      ifdef _WIN32
 #       define QGPGME_EXPORT __declspec(dllexport)
 #      else
 #       define QGPGME_EXPORT __attribute__((visibility("default")))
 #      endif
 #    else
         /* We are using this library */
-#      ifdef WIN32
+#      ifdef _WIN32
 #       define QGPGME_EXPORT __declspec(dllimport)
 #      else
 #       define QGPGME_EXPORT __attribute__((visibility("default")))
@@ -55,7 +55,7 @@
 #  endif
 
 #  ifndef QGPGME_NO_EXPORT
-#    ifdef WIN32
+#    ifdef _WIN32
 #     define QGPGME_NO_EXPORT
 #    else
 #     define QGPGME_NO_EXPORT __attribute__((visibility("hidden")))
@@ -64,7 +64,11 @@
 #endif
 
 #ifndef QGPGME_DEPRECATED
-#  define QGPGME_DEPRECATED __attribute__ ((__deprecated__))
+#  ifdef _MSC_VER
+#    define QGPGME_DEPRECATED __declspec(deprecated("deprecated"))
+#  else
+#    define QGPGME_DEPRECATED __attribute__ ((__deprecated__))
+#  endif
 #endif
 
 #ifndef QGPGME_DEPRECATED_EXPORT