forked from myfreeer/aria2-build-msys2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libssh2-1.9.0-wincng-multiple-definition.patch
53 lines (47 loc) · 1.55 KB
/
libssh2-1.9.0-wincng-multiple-definition.patch
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
From ba149e804ef653cc05ed9803dfc94519ce9328f7 Mon Sep 17 00:00:00 2001
From: Marc Hoersken <[email protected]>
Date: Sun, 31 May 2020 21:24:58 +0200
Subject: [PATCH] wincng: fix multiple definition of `_libssh2_wincng' (#479)
Add missing include guard and move global state
from header to source file by using extern.
---
src/wincng.c | 2 ++
src/wincng.h | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/wincng.c b/src/wincng.c
index 4bebc6407..dffd2ed36 100755
--- a/src/wincng.c
+++ b/src/wincng.c
@@ -208,6 +208,8 @@
* Windows CNG backend: Generic functions
*/
+struct _libssh2_wincng_ctx _libssh2_wincng;
+
void
_libssh2_wincng_init(void)
{
diff --git a/src/wincng.h b/src/wincng.h
index f5838d0e6..c817f090c 100755
--- a/src/wincng.h
+++ b/src/wincng.h
@@ -1,5 +1,7 @@
+#ifndef __LIBSSH2_WINCNG_H
+#define __LIBSSH2_WINCNG_H
/*
- * Copyright (C) 2013-2015 Marc Hoersken <[email protected]>
+ * Copyright (C) 2013-2020 Marc Hoersken <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@@ -101,7 +103,7 @@ struct _libssh2_wincng_ctx {
BCRYPT_ALG_HANDLE hAlg3DES_CBC;
};
-struct _libssh2_wincng_ctx _libssh2_wincng;
+extern struct _libssh2_wincng_ctx _libssh2_wincng;
/*******************************************************************/
@@ -569,3 +571,5 @@ _libssh2_dh_secret(_libssh2_dh_ctx *dhctx, _libssh2_bn *secret,
_libssh2_bn *f, _libssh2_bn *p);
extern void
_libssh2_dh_dtor(_libssh2_dh_ctx *dhctx);
+
+#endif /* __LIBSSH2_WINCNG_H */