gnutls: fix build with zabbix
[feed/packages.git] / libs / gnutls / patches / 040-build-use-clang-format-on-off-annotation.patch
1 From 18345986e29c820e64daced78232f236fd4a4e6e Mon Sep 17 00:00:00 2001
2 From: Daiki Ueno <ueno@gnu.org>
3 Date: Thu, 16 Mar 2023 16:21:37 +0900
4 Subject: [PATCH] build: use /* clang-format {on|off} */ annotation
5
6 Signed-off-by: Daiki Ueno <ueno@gnu.org>
7 ---
8 lib/includes/gnutls/abstract.h | 4 ----
9 lib/includes/gnutls/compat.h | 4 ----
10 lib/includes/gnutls/crypto.h | 4 ----
11 lib/includes/gnutls/dtls.h | 4 ----
12 lib/includes/gnutls/gnutls.h.in | 18 ++++++++----------
13 lib/includes/gnutls/ocsp.h | 4 ----
14 lib/includes/gnutls/openpgp.h | 4 ----
15 lib/includes/gnutls/pkcs11.h | 4 ----
16 lib/includes/gnutls/pkcs12.h | 4 ----
17 lib/includes/gnutls/pkcs7.h | 4 ----
18 lib/includes/gnutls/socket.h | 4 ----
19 lib/includes/gnutls/system-keys.h | 4 ----
20 lib/includes/gnutls/tpm.h | 4 ----
21 lib/includes/gnutls/urls.h | 4 ----
22 lib/includes/gnutls/x509-ext.h | 4 ----
23 lib/includes/gnutls/x509.h | 4 ----
24 tests/test-chains-issuer-aia.h | 4 ----
25 tests/test-chains.h | 4 ----
26 18 files changed, 8 insertions(+), 78 deletions(-)
27
28 --- a/lib/includes/gnutls/abstract.h
29 +++ b/lib/includes/gnutls/abstract.h
30 @@ -30,11 +30,9 @@
31 # include <gnutls/openpgp.h>
32 # include <gnutls/tpm.h>
33
34 -/* *INDENT-OFF* */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 -/* *INDENT-ON* */
39
40 /* Public key operations */
41
42 @@ -748,10 +746,8 @@ gnutls_pubkey_print(gnutls_pubkey_t pubk
43 gnutls_certificate_print_formats_t format,
44 gnutls_datum_t * out);
45
46 -/* *INDENT-OFF* */
47 #ifdef __cplusplus
48 }
49 #endif
50 -/* *INDENT-ON* */
51
52 #endif /* GNUTLS_ABSTRACT_H */
53 --- a/lib/includes/gnutls/compat.h
54 +++ b/lib/includes/gnutls/compat.h
55 @@ -25,11 +25,9 @@
56 #ifndef GNUTLS_COMPAT_H
57 # define GNUTLS_COMPAT_H
58
59 -/* *INDENT-OFF* */
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 -/* *INDENT-ON* */
64
65 # ifdef __GNUC__
66
67 @@ -228,10 +226,8 @@ int gnutls_priority_compression_list(gnu
68 const unsigned int **list)
69 _GNUTLS_GCC_ATTR_DEPRECATED;
70
71 -/* *INDENT-OFF* */
72 #ifdef __cplusplus
73 }
74 #endif
75 -/* *INDENT-ON* */
76
77 #endif /* GNUTLS_COMPAT_H */
78 --- a/lib/includes/gnutls/crypto.h
79 +++ b/lib/includes/gnutls/crypto.h
80 @@ -25,11 +25,9 @@
81
82 # include <gnutls/gnutls.h>
83
84 -/* *INDENT-OFF* */
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88 -/* *INDENT-ON* */
89
90 typedef struct api_cipher_hd_st *gnutls_cipher_hd_t;
91
92 @@ -335,10 +333,8 @@ int gnutls_encode_gost_rs_value(gnutls_d
93 int gnutls_decode_gost_rs_value(const gnutls_datum_t * sig_value,
94 gnutls_datum_t * r, gnutls_datum_t * s);
95
96 -/* *INDENT-OFF* */
97 #ifdef __cplusplus
98 }
99 #endif
100 -/* *INDENT-ON* */
101
102 #endif /* GNUTLS_CRYPTO_H */
103 --- a/lib/includes/gnutls/dtls.h
104 +++ b/lib/includes/gnutls/dtls.h
105 @@ -29,11 +29,9 @@
106
107 # include <gnutls/gnutls.h>
108
109 -/* *INDENT-OFF* */
110 #ifdef __cplusplus
111 extern "C" {
112 #endif
113 -/* *INDENT-ON* */
114
115 # define GNUTLS_COOKIE_KEY_SIZE 16
116
117 @@ -84,10 +82,8 @@ void gnutls_dtls_prestate_set(gnutls_ses
118
119 unsigned int gnutls_record_get_discarded(gnutls_session_t session);
120
121 -/* *INDENT-OFF* */
122 #ifdef __cplusplus
123 }
124 #endif
125 -/* *INDENT-ON* */
126
127 #endif /* GNUTLS_DTLS_H */
128 --- a/lib/includes/gnutls/gnutls.h.in
129 +++ b/lib/includes/gnutls/gnutls.h.in
130 @@ -45,19 +45,19 @@
131 /* Get time_t. */
132 # include <time.h>
133
134 -/* *INDENT-OFF* */
135 #ifdef __cplusplus
136 extern "C" {
137 #endif
138 -/* *INDENT-ON* */
139
140 # define GNUTLS_VERSION "@VERSION@"
141
142 -# define GNUTLS_VERSION_MAJOR @MAJOR_VERSION@
143 -# define GNUTLS_VERSION_MINOR @MINOR_VERSION@
144 -# define GNUTLS_VERSION_PATCH @PATCH_VERSION@
145 +/* clang-format off */
146 +#define GNUTLS_VERSION_MAJOR @MAJOR_VERSION@
147 +#define GNUTLS_VERSION_MINOR @MINOR_VERSION@
148 +#define GNUTLS_VERSION_PATCH @PATCH_VERSION@
149
150 -# define GNUTLS_VERSION_NUMBER @NUMBER_VERSION@
151 +#define GNUTLS_VERSION_NUMBER @NUMBER_VERSION@
152 +/* clang-format on */
153
154 # define GNUTLS_CIPHER_RIJNDAEL_128_CBC GNUTLS_CIPHER_AES_128_CBC
155 # define GNUTLS_CIPHER_RIJNDAEL_256_CBC GNUTLS_CIPHER_AES_256_CBC
156 @@ -2365,9 +2365,9 @@ int gnutls_dh_params_cpy(gnutls_dh_param
157
158 /* Session stuff
159 */
160 -/* *INDENT-OFF* */
161 +/* clang-format off */
162 @DEFINE_IOVEC_T@
163 -/* *INDENT-ON* */
164 +/* clang-format on */
165
166 typedef ssize_t(*gnutls_pull_func) (gnutls_transport_ptr_t, void *, size_t);
167 typedef ssize_t(*gnutls_push_func) (gnutls_transport_ptr_t, const void *,
168 @@ -3634,11 +3634,9 @@ gnutls_transport_is_ktls_enabled(gnutls_
169 # define GNUTLS_E_APPLICATION_ERROR_MAX -65000
170 # define GNUTLS_E_APPLICATION_ERROR_MIN -65500
171
172 -/* *INDENT-OFF* */
173 #ifdef __cplusplus
174 }
175 #endif
176 -/* *INDENT-ON* */
177
178 # include <gnutls/compat.h>
179
180 --- a/lib/includes/gnutls/ocsp.h
181 +++ b/lib/includes/gnutls/ocsp.h
182 @@ -29,11 +29,9 @@
183 # include <gnutls/gnutls.h>
184 # include <gnutls/x509.h>
185
186 -/* *INDENT-OFF* */
187 #ifdef __cplusplus
188 extern "C" {
189 #endif
190 -/* *INDENT-ON* */
191
192 # define GNUTLS_OCSP_NONCE "1.3.6.1.5.5.7.48.1.2"
193
194 @@ -269,10 +267,8 @@ gnutls_ocsp_resp_list_import2(gnutls_ocs
195 const gnutls_datum_t * resp_data,
196 gnutls_x509_crt_fmt_t format, unsigned int flags);
197
198 -/* *INDENT-OFF* */
199 #ifdef __cplusplus
200 }
201 #endif
202 -/* *INDENT-ON* */
203
204 #endif /* GNUTLS_OCSP_H */
205 --- a/lib/includes/gnutls/openpgp.h
206 +++ b/lib/includes/gnutls/openpgp.h
207 @@ -30,11 +30,9 @@
208 # include <gnutls/gnutls.h>
209 # include <limits.h>
210
211 -/* *INDENT-OFF* */
212 #ifdef __cplusplus
213 extern "C" {
214 #endif
215 -/* *INDENT-ON* */
216
217 /* Openpgp certificate stuff
218 */
219 @@ -424,10 +422,8 @@ int gnutls_certificate_set_openpgp_keyri
220 (gnutls_certificate_credentials_t c, const char *file,
221 gnutls_openpgp_crt_fmt_t format) _GNUTLS_GCC_ATTR_DEPRECATED;
222
223 -/* *INDENT-OFF* */
224 #ifdef __cplusplus
225 }
226 #endif
227 -/* *INDENT-ON* */
228
229 #endif /* GNUTLS_OPENPGP_H */
230 --- a/lib/includes/gnutls/pkcs11.h
231 +++ b/lib/includes/gnutls/pkcs11.h
232 @@ -28,11 +28,9 @@
233 # include <gnutls/gnutls.h>
234 # include <gnutls/x509.h>
235
236 -/* *INDENT-OFF* */
237 #ifdef __cplusplus
238 extern "C" {
239 #endif
240 -/* *INDENT-ON* */
241
242 # define GNUTLS_PKCS11_MAX_PIN_LEN 256
243
244 @@ -491,10 +489,8 @@ gnutls_pkcs11_copy_attached_extension(co
245
246 # define gnutls_x509_crt_import_pkcs11_url gnutls_x509_crt_import_url
247
248 -/* *INDENT-OFF* */
249 #ifdef __cplusplus
250 }
251 #endif
252 -/* *INDENT-ON* */
253
254 #endif /* GNUTLS_PKCS11_H */
255 --- a/lib/includes/gnutls/pkcs12.h
256 +++ b/lib/includes/gnutls/pkcs12.h
257 @@ -25,11 +25,9 @@
258
259 # include <gnutls/x509.h>
260
261 -/* *INDENT-OFF* */
262 #ifdef __cplusplus
263 extern "C" {
264 #endif
265 -/* *INDENT-ON* */
266
267 /* PKCS12 structures handling
268 */
269 @@ -138,10 +136,8 @@ int gnutls_pkcs12_bag_get_friendly_name(
270 int gnutls_pkcs12_bag_set_friendly_name(gnutls_pkcs12_bag_t bag,
271 unsigned indx, const char *name);
272
273 -/* *INDENT-OFF* */
274 #ifdef __cplusplus
275 }
276 #endif
277 -/* *INDENT-ON* */
278
279 #endif /* GNUTLS_PKCS12_H */
280 --- a/lib/includes/gnutls/pkcs7.h
281 +++ b/lib/includes/gnutls/pkcs7.h
282 @@ -31,11 +31,9 @@
283 # include <gnutls/gnutls.h>
284 # include <gnutls/x509.h>
285
286 -/* *INDENT-OFF* */
287 #ifdef __cplusplus
288 extern "C" {
289 #endif
290 -/* *INDENT-ON* */
291
292 /* PKCS7 structures handling
293 */
294 @@ -149,10 +147,8 @@ int gnutls_pkcs7_print_signature_info(gn
295 gnutls_certificate_print_formats_t format,
296 gnutls_datum_t * out);
297
298 -/* *INDENT-OFF* */
299 #ifdef __cplusplus
300 }
301 #endif
302 -/* *INDENT-ON* */
303
304 #endif /* GNUTLS_PKCS7_H */
305 --- a/lib/includes/gnutls/socket.h
306 +++ b/lib/includes/gnutls/socket.h
307 @@ -31,11 +31,9 @@
308 /* Get socklen_t */
309 # include <sys/socket.h>
310
311 -/* *INDENT-OFF* */
312 #ifdef __cplusplus
313 extern "C" {
314 #endif
315 -/* *INDENT-ON* */
316
317 void gnutls_transport_set_fastopen(gnutls_session_t session,
318 int fd,
319 @@ -43,10 +41,8 @@ void gnutls_transport_set_fastopen(gnutl
320 socklen_t connect_addrlen,
321 unsigned int flags);
322
323 -/* *INDENT-OFF* */
324 #ifdef __cplusplus
325 }
326 #endif
327 -/* *INDENT-ON* */
328
329 #endif /* GNUTLS_SOCKET_H */
330 --- a/lib/includes/gnutls/system-keys.h
331 +++ b/lib/includes/gnutls/system-keys.h
332 @@ -31,11 +31,9 @@
333 * they will be requested through the pin callbacks.
334 */
335
336 -/* *INDENT-OFF* */
337 #ifdef __cplusplus
338 extern "C" {
339 #endif
340 -/* *INDENT-ON* */
341
342 struct system_key_iter_st;
343 typedef struct system_key_iter_st *gnutls_system_key_iter_t;
344 @@ -54,10 +52,8 @@ int gnutls_system_key_add_x509(gnutls_x5
345 gnutls_x509_privkey_t privkey, const char *label,
346 char **cert_url, char **key_url);
347
348 -/* *INDENT-OFF* */
349 #ifdef __cplusplus
350 }
351 #endif
352 -/* *INDENT-ON* */
353
354 #endif /* GNUTLS_SYSTEM_KEYS_H */
355 --- a/lib/includes/gnutls/tpm.h
356 +++ b/lib/includes/gnutls/tpm.h
357 @@ -26,11 +26,9 @@
358 # include <gnutls/gnutls.h>
359 # include <gnutls/x509.h>
360
361 -/* *INDENT-OFF* */
362 #ifdef __cplusplus
363 extern "C" {
364 #endif
365 -/* *INDENT-ON* */
366
367 struct tpm_key_list_st;
368 typedef struct tpm_key_list_st *gnutls_tpm_key_list_t;
369 @@ -71,10 +69,8 @@ int gnutls_tpm_get_registered(gnutls_tpm
370 int gnutls_tpm_privkey_delete(const char *url, const char *srk_password);
371
372
373 -/* *INDENT-OFF* */
374 #ifdef __cplusplus
375 }
376 #endif
377 -/* *INDENT-ON* */
378
379 #endif /* GNUTLS_TPM_H */
380 --- a/lib/includes/gnutls/urls.h
381 +++ b/lib/includes/gnutls/urls.h
382 @@ -31,11 +31,9 @@
383 * keys and certificates.
384 */
385
386 -/* *INDENT-OFF* */
387 #ifdef __cplusplus
388 extern "C" {
389 #endif
390 -/* *INDENT-ON* */
391
392 typedef int (*gnutls_privkey_import_url_func)(gnutls_privkey_t pkey,
393 const char *url, unsigned flags);
394 @@ -71,10 +69,8 @@ typedef struct gnutls_custom_url_st {
395
396 int gnutls_register_custom_url(const gnutls_custom_url_st * st);
397
398 -/* *INDENT-OFF* */
399 #ifdef __cplusplus
400 }
401 #endif
402 -/* *INDENT-ON* */
403
404 #endif /* GNUTLS_URLS_H */
405 --- a/lib/includes/gnutls/x509-ext.h
406 +++ b/lib/includes/gnutls/x509-ext.h
407 @@ -28,11 +28,9 @@
408 # include <gnutls/gnutls.h>
409 # include <gnutls/x509.h>
410
411 -/* *INDENT-OFF* */
412 #ifdef __cplusplus
413 extern "C" {
414 #endif
415 -/* *INDENT-ON* */
416
417 typedef struct gnutls_subject_alt_names_st *gnutls_subject_alt_names_t;
418
419 @@ -215,10 +213,8 @@ int gnutls_x509_ct_sct_get(const gnutls_
420 gnutls_sign_algorithm_t * sigalg,
421 gnutls_datum_t * signature);
422
423 -/* *INDENT-OFF* */
424 #ifdef __cplusplus
425 }
426 #endif
427 -/* *INDENT-ON* */
428
429 #endif /* GNUTLS_X509_EXT_H */
430 --- a/lib/includes/gnutls/x509.h
431 +++ b/lib/includes/gnutls/x509.h
432 @@ -30,11 +30,9 @@
433
434 # include <gnutls/gnutls.h>
435
436 -/* *INDENT-OFF* */
437 #ifdef __cplusplus
438 extern "C" {
439 #endif
440 -/* *INDENT-ON* */
441
442 /* Some OIDs usually found in Distinguished names, or
443 * in Subject Directory Attribute extensions.
444 @@ -1710,10 +1708,8 @@ gnutls_x509_ext_print(gnutls_x509_ext_st
445
446 # include <gnutls/pkcs7.h>
447
448 -/* *INDENT-OFF* */
449 #ifdef __cplusplus
450 }
451 #endif
452 -/* *INDENT-ON* */
453
454 #endif /* GNUTLS_X509_H */
455 --- a/tests/test-chains-issuer-aia.h
456 +++ b/tests/test-chains-issuer-aia.h
457 @@ -23,8 +23,6 @@
458 #ifndef GNUTLS_TESTS_TEST_CHAINS_ISSUER_AIA_H
459 # define GNUTLS_TESTS_TEST_CHAINS_ISSUER_AIA_H
460
461 -/* *INDENT-OFF* */
462 -
463 #define MAX_CHAIN 1
464
465 static const char *missing_cert_aia[] = {
466 @@ -132,6 +130,4 @@ static const char *missing_cert_aia_ca[]
467 # pragma GCC diagnostic pop
468 #endif
469
470 -/* *INDENT-ON* */
471 -
472 #endif /* GNUTLS_TESTS_TEST_CHAINS_ISSUER_AIA_H */
473 --- a/tests/test-chains.h
474 +++ b/tests/test-chains.h
475 @@ -23,8 +23,6 @@
476 #ifndef GNUTLS_TESTS_TEST_CHAINS_H
477 # define GNUTLS_TESTS_TEST_CHAINS_H
478
479 -/* *INDENT-OFF* */
480 -
481 #define MAX_CHAIN 10
482
483 static const char *chain_with_no_subject_id_in_ca_ok[] = {
484 @@ -4449,6 +4447,4 @@ static struct
485 # pragma GCC diagnostic pop
486 #endif
487
488 -/* *INDENT-ON* */
489 -
490 #endif /* GNUTLS_TESTS_TEST_CHAINS_H */