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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
|
diff -ur gnupg-2.2.9/agent/agent.h gnupg-2.2.9+iPhone/agent/agent.h
--- gnupg-2.2.9/agent/agent.h 2018-06-12 01:25:39.000000000 -1000
+++ gnupg-2.2.9+iPhone/agent/agent.h 2018-08-15 08:34:08.000000000 -1000
@@ -55,6 +55,7 @@
/* A large struct name "opt" to keep global flags */
+EXTERN_UNLESS_MAIN_MODULE
struct
{
unsigned int debug; /* Debug flags (DBG_foo_VALUE) */
diff -ur gnupg-2.2.9/agent/gpg-agent.c gnupg-2.2.9+iPhone/agent/gpg-agent.c
--- gnupg-2.2.9/agent/gpg-agent.c 2018-06-06 06:29:59.000000000 -1000
+++ gnupg-2.2.9+iPhone/agent/gpg-agent.c 2018-08-14 22:16:12.000000000 -1000
@@ -50,9 +50,11 @@
#include <npth.h>
#define GNUPG_COMMON_NEED_AFLOCAL
+#define INCLUDED_BY_MAIN_MODULE 1
#include "agent.h"
#include <assuan.h> /* Malloc hooks and socket wrappers. */
+#include "../common/iobuf.h"
#include "../common/i18n.h"
#include "../common/sysutils.h"
#include "../common/gc-opt-flags.h"
diff -ur gnupg-2.2.9/agent/preset-passphrase.c gnupg-2.2.9+iPhone/agent/preset-passphrase.c
--- gnupg-2.2.9/agent/preset-passphrase.c 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/agent/preset-passphrase.c 2018-08-14 22:16:12.000000000 -1000
@@ -44,6 +44,7 @@
# include <windows.h> /* To initialize the sockets. fixme */
#endif
+#define INCLUDED_BY_MAIN_MODULE 1
#include "agent.h"
#include "../common/simple-pwquery.h"
#include "../common/i18n.h"
diff -ur gnupg-2.2.9/agent/protect-tool.c gnupg-2.2.9+iPhone/agent/protect-tool.c
--- gnupg-2.2.9/agent/protect-tool.c 2018-03-26 20:13:47.000000000 -1000
+++ gnupg-2.2.9+iPhone/agent/protect-tool.c 2018-08-14 22:22:40.000000000 -1000
@@ -38,7 +38,9 @@
#include <fcntl.h> /* for setmode() */
#endif
+#define INCLUDED_BY_MAIN_MODULE 1
#include "agent.h"
+#include "../common/iobuf.h"
#include "../common/i18n.h"
#include "../common/get-passphrase.h"
#include "../common/sysutils.h"
diff -ur gnupg-2.2.9/agent/t-protect.c gnupg-2.2.9+iPhone/agent/t-protect.c
--- gnupg-2.2.9/agent/t-protect.c 2017-12-07 20:40:06.000000000 -1000
+++ gnupg-2.2.9+iPhone/agent/t-protect.c 2018-08-14 22:16:12.000000000 -1000
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <assert.h>
+#define INCLUDED_BY_MAIN_MODULE 1
#include "agent.h"
diff -ur gnupg-2.2.9/common/iobuf.h gnupg-2.2.9+iPhone/common/iobuf.h
--- gnupg-2.2.9/common/iobuf.h 2018-06-12 01:25:39.000000000 -1000
+++ gnupg-2.2.9+iPhone/common/iobuf.h 2018-08-14 22:16:12.000000000 -1000
@@ -250,7 +250,7 @@
};
#ifndef EXTERN_UNLESS_MAIN_MODULE
-#if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+#if (defined (__riscos__) || defined (__APPLE__)) && !defined (INCLUDED_BY_MAIN_MODULE)
#define EXTERN_UNLESS_MAIN_MODULE extern
#else
#define EXTERN_UNLESS_MAIN_MODULE
diff -ur gnupg-2.2.9/common/t-iobuf.c gnupg-2.2.9+iPhone/common/t-iobuf.c
--- gnupg-2.2.9/common/t-iobuf.c 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/common/t-iobuf.c 2018-08-14 22:16:12.000000000 -1000
@@ -4,6 +4,7 @@
#include <assert.h>
#include <stdlib.h>
+#define INCLUDED_BY_MAIN_MODULE 1
#include "iobuf.h"
#include "stringhelp.h"
diff -ur gnupg-2.2.9/common/t-name-value.c gnupg-2.2.9+iPhone/common/t-name-value.c
--- gnupg-2.2.9/common/t-name-value.c 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/common/t-name-value.c 2018-08-14 22:16:12.000000000 -1000
@@ -25,6 +25,8 @@
#include <unistd.h>
#include <sys/stat.h>
+#define INCLUDED_BY_MAIN_MODULE 1
+#include "iobuf.h"
#include "util.h"
#include "name-value.h"
diff -ur gnupg-2.2.9/common/t-strlist.c gnupg-2.2.9+iPhone/common/t-strlist.c
--- gnupg-2.2.9/common/t-strlist.c 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/common/t-strlist.c 2018-08-14 22:16:12.000000000 -1000
@@ -31,6 +31,8 @@
#include <config.h>
#include <string.h>
+#define INCLUDED_BY_MAIN_MODULE 1
+#include "iobuf.h"
#include "strlist.h"
#include "t-support.h"
diff -ur gnupg-2.2.9/common/util.h gnupg-2.2.9+iPhone/common/util.h
--- gnupg-2.2.9/common/util.h 2018-06-12 01:25:39.000000000 -1000
+++ gnupg-2.2.9+iPhone/common/util.h 2018-08-15 08:24:16.000000000 -1000
@@ -55,6 +55,13 @@
# define GPG_ERR_DNS_TIMEOUT 718
#endif
+#ifndef EXTERN_UNLESS_MAIN_MODULE
+#if (defined (__riscos__) || defined (__APPLE__)) && !defined (INCLUDED_BY_MAIN_MODULE)
+#define EXTERN_UNLESS_MAIN_MODULE extern
+#else
+#define EXTERN_UNLESS_MAIN_MODULE
+#endif
+#endif
/* Hash function used with libksba. */
#define HASH_FNC ((void (*)(void *, const void*,size_t))gcry_md_write)
diff -ur gnupg-2.2.9/dirmngr/dirmngr.c gnupg-2.2.9+iPhone/dirmngr/dirmngr.c
--- gnupg-2.2.9/dirmngr/dirmngr.c 2018-06-12 01:25:39.000000000 -1000
+++ gnupg-2.2.9+iPhone/dirmngr/dirmngr.c 2018-08-14 22:28:37.000000000 -1000
@@ -56,10 +56,12 @@
#define GNUPG_COMMON_NEED_AFLOCAL
+#define INCLUDED_BY_MAIN_MODULE 1
#include "dirmngr.h"
#include <assuan.h>
+#include "../common/iobuf.h"
#include "certcache.h"
#include "crlcache.h"
#include "crlfetch.h"
diff -ur gnupg-2.2.9/dirmngr/dirmngr.h gnupg-2.2.9+iPhone/dirmngr/dirmngr.h
--- gnupg-2.2.9/dirmngr/dirmngr.h 2017-12-11 00:30:45.000000000 -1000
+++ gnupg-2.2.9+iPhone/dirmngr/dirmngr.h 2018-08-15 08:35:31.000000000 -1000
@@ -75,6 +75,7 @@
/* A large struct named "opt" to keep global flags. */
+EXTERN_UNLESS_MAIN_MODULE
struct
{
unsigned int debug; /* debug flags (DBG_foo_VALUE) */
diff -ur gnupg-2.2.9/g10/options.h gnupg-2.2.9+iPhone/g10/options.h
--- gnupg-2.2.9/g10/options.h 2018-06-12 01:25:39.000000000 -1000
+++ gnupg-2.2.9+iPhone/g10/options.h 2018-08-15 08:31:23.000000000 -1000
@@ -30,15 +30,6 @@
#include "../common/session-env.h"
#include "../common/compliance.h"
-#ifndef EXTERN_UNLESS_MAIN_MODULE
-/* Norcraft can't cope with common symbols */
-#if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
-#define EXTERN_UNLESS_MAIN_MODULE extern
-#else
-#define EXTERN_UNLESS_MAIN_MODULE
-#endif
-#endif
-
/* Declaration of a keyserver spec type. The definition is found in
../common/keyserver.h. */
struct keyserver_spec;
diff -ur gnupg-2.2.9/kbx/kbxutil.c gnupg-2.2.9+iPhone/kbx/kbxutil.c
--- gnupg-2.2.9/kbx/kbxutil.c 2018-06-12 01:25:39.000000000 -1000
+++ gnupg-2.2.9+iPhone/kbx/kbxutil.c 2018-08-14 22:16:12.000000000 -1000
@@ -29,6 +29,8 @@
#include <assert.h>
#include <gpg-error.h>
+#define INCLUDED_BY_MAIN_MODULE 1
+#include "../common/iobuf.h"
#include "../common/logging.h"
#include "../common/argparse.h"
#include "../common/stringhelp.h"
diff -ur gnupg-2.2.9/scd/scdaemon.c gnupg-2.2.9+iPhone/scd/scdaemon.c
--- gnupg-2.2.9/scd/scdaemon.c 2018-03-21 08:43:33.000000000 -1000
+++ gnupg-2.2.9+iPhone/scd/scdaemon.c 2018-08-14 22:25:31.000000000 -1000
@@ -38,12 +38,14 @@
#include <npth.h>
#define GNUPG_COMMON_NEED_AFLOCAL
+#define INCLUDED_BY_MAIN_MODULE 1
#include "scdaemon.h"
#include <ksba.h>
#include <gcrypt.h>
#include <assuan.h> /* malloc hooks */
+#include "../common/iobuf.h"
#include "../common/i18n.h"
#include "../common/sysutils.h"
#include "app-common.h"
diff -ur gnupg-2.2.9/scd/scdaemon.h gnupg-2.2.9+iPhone/scd/scdaemon.h
--- gnupg-2.2.9/scd/scdaemon.h 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/scd/scdaemon.h 2018-08-15 08:35:05.000000000 -1000
@@ -44,6 +44,7 @@
/* A large struct name "opt" to keep global flags. */
+EXTERN_UNLESS_MAIN_MODULE
struct
{
unsigned int debug; /* Debug flags (DBG_foo_VALUE). */
diff -ur gnupg-2.2.9/sm/gpgsm.c gnupg-2.2.9+iPhone/sm/gpgsm.c
--- gnupg-2.2.9/sm/gpgsm.c 2018-06-12 01:25:39.000000000 -1000
+++ gnupg-2.2.9+iPhone/sm/gpgsm.c 2018-08-14 22:16:12.000000000 -1000
@@ -28,6 +28,7 @@
#include <fcntl.h>
/*#include <mcheck.h>*/
+#define INCLUDED_BY_MAIN_MODULE 1
#include "gpgsm.h"
#include <gcrypt.h>
#include <assuan.h> /* malloc hooks */
diff -ur gnupg-2.2.9/sm/gpgsm.h gnupg-2.2.9+iPhone/sm/gpgsm.h
--- gnupg-2.2.9/sm/gpgsm.h 2018-06-12 01:25:39.000000000 -1000
+++ gnupg-2.2.9+iPhone/sm/gpgsm.h 2018-08-15 08:36:03.000000000 -1000
@@ -52,6 +52,7 @@
/* A large struct named "opt" to keep global flags. */
+EXTERN_UNLESS_MAIN_MODULE
struct
{
unsigned int debug; /* debug flags (DBG_foo_VALUE) */
diff -ur gnupg-2.2.9/tools/gpg-check-pattern.c gnupg-2.2.9+iPhone/tools/gpg-check-pattern.c
--- gnupg-2.2.9/tools/gpg-check-pattern.c 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/tools/gpg-check-pattern.c 2018-08-15 08:26:34.000000000 -1000
@@ -40,6 +40,8 @@
#include <regex.h>
#include <ctype.h>
+#define INCLUDED_BY_MAIN_MODULE 1
+#include "../common/iobuf.h"
#include "../common/util.h"
#include "../common/i18n.h"
#include "../common/sysutils.h"
diff -ur gnupg-2.2.9/tools/gpg-connect-agent.c gnupg-2.2.9+iPhone/tools/gpg-connect-agent.c
--- gnupg-2.2.9/tools/gpg-connect-agent.c 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/tools/gpg-connect-agent.c 2018-08-15 08:22:21.000000000 -1000
@@ -29,6 +29,8 @@
#include <unistd.h>
#include <assert.h>
+#define INCLUDED_BY_MAIN_MODULE 1
+#include "../common/iobuf.h"
#include "../common/i18n.h"
#include "../common/util.h"
#include "../common/asshelp.h"
diff -ur gnupg-2.2.9/tools/gpg-wks-client.c gnupg-2.2.9+iPhone/tools/gpg-wks-client.c
--- gnupg-2.2.9/tools/gpg-wks-client.c 2018-02-20 04:09:35.000000000 -1000
+++ gnupg-2.2.9+iPhone/tools/gpg-wks-client.c 2018-08-15 08:26:19.000000000 -1000
@@ -23,6 +23,8 @@
#include <stdlib.h>
#include <string.h>
+#define INCLUDED_BY_MAIN_MODULE 1
+#include "../common/iobuf.h"
#include "../common/util.h"
#include "../common/status.h"
#include "../common/i18n.h"
diff -ur gnupg-2.2.9/tools/gpg-wks.h gnupg-2.2.9+iPhone/tools/gpg-wks.h
--- gnupg-2.2.9/tools/gpg-wks.h 2018-02-20 04:06:52.000000000 -1000
+++ gnupg-2.2.9+iPhone/tools/gpg-wks.h 2018-08-14 22:16:12.000000000 -1000
@@ -30,6 +30,7 @@
/* We keep all global options in the structure OPT. */
+EXTERN_UNLESS_MAIN_MODULE
struct
{
int verbose;
diff -ur gnupg-2.2.9/tools/gpgconf.c gnupg-2.2.9+iPhone/tools/gpgconf.c
--- gnupg-2.2.9/tools/gpgconf.c 2018-04-09 02:40:19.000000000 -1000
+++ gnupg-2.2.9+iPhone/tools/gpgconf.c 2018-08-14 22:29:44.000000000 -1000
@@ -25,7 +25,9 @@
#include <string.h>
#include <unistd.h>
+#define INCLUDED_BY_MAIN_MODULE 1
#include "gpgconf.h"
+#include "../common/iobuf.h"
#include "../common/i18n.h"
#include "../common/sysutils.h"
#include "../common/init.h"
diff -ur gnupg-2.2.9/tools/gpgconf.h gnupg-2.2.9+iPhone/tools/gpgconf.h
--- gnupg-2.2.9/tools/gpgconf.h 2017-12-18 06:07:27.000000000 -1000
+++ gnupg-2.2.9+iPhone/tools/gpgconf.h 2018-08-15 08:32:29.000000000 -1000
@@ -23,6 +23,7 @@
#include "../common/util.h"
/* We keep all global options in the structure OPT. */
+EXTERN_UNLESS_MAIN_MODULE
struct
{
int verbose; /* Verbosity level. */
diff -ur gnupg-2.2.9/tools/gpgtar.c gnupg-2.2.9+iPhone/tools/gpgtar.c
--- gnupg-2.2.9/tools/gpgtar.c 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/tools/gpgtar.c 2018-08-15 08:25:45.000000000 -1000
@@ -34,6 +34,8 @@
#include <string.h>
#include <assert.h>
+#define INCLUDED_BY_MAIN_MODULE 1
+#include "../common/iobuf.h"
#include "../common/util.h"
#include "../common/i18n.h"
#include "../common/sysutils.h"
diff -ur gnupg-2.2.9/tools/gpgtar.h gnupg-2.2.9+iPhone/tools/gpgtar.h
--- gnupg-2.2.9/tools/gpgtar.h 2017-08-28 00:22:54.000000000 -1000
+++ gnupg-2.2.9+iPhone/tools/gpgtar.h 2018-08-15 08:31:48.000000000 -1000
@@ -24,6 +24,7 @@
#include "../common/strlist.h"
/* We keep all global options in the structure OPT. */
+EXTERN_UNLESS_MAIN_MODULE
struct
{
int verbose;
|