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
|
--- ./include/sha2_openbsd.h.orig
+++ ./include/sha2_openbsd.h
@@ -63,7 +63,10 @@
u_int8_t buffer[SHA512_BLOCK_LENGTH];
} SHA2_CTX;
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void SHA224Init(SHA2_CTX *);
void SHA224Transform(u_int32_t state[8], const u_int8_t [SHA224_BLOCK_LENGTH]);
void SHA224Update(SHA2_CTX *, const u_int8_t *, size_t)
@@ -131,6 +134,8 @@
char *SHA512Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
__attribute__((__bounded__(__minbytes__,3,SHA512_DIGEST_STRING_LENGTH)));
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
#endif /* _SHA2_H */
--- ./include/md5_openbsd.h.orig
+++ ./include/md5_openbsd.h
@@ -15,6 +15,8 @@
#ifndef _MD5_H_
#define _MD5_H_
+#include <sys/types.h>
+
#define MD5_BLOCK_LENGTH 64
#define MD5_DIGEST_LENGTH 16
#define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH * 2 + 1)
@@ -25,7 +27,9 @@
u_int8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
} MD5_CTX;
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
void MD5Init(MD5_CTX *);
void MD5Update(MD5_CTX *, const u_int8_t *, size_t)
__attribute__((__bounded__(__string__,2,3)));
@@ -44,6 +48,8 @@
char *MD5Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
__attribute__((__bounded__(__minbytes__,3,MD5_DIGEST_STRING_LENGTH)));
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
#endif /* _MD5_H_ */
|