Remove hidden dependencies from public headers Include <sys/types.h> in all public headers as they need them, so that programs do not need to add such header to be able to build.
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
diff --git a/include/md4.h b/include/md4.h
index 57f77bc..ccd524f 100644
--- a/include/md4.h
+++ b/include/md4.h
@@ -16,6 +16,9 @@
#ifndef _MD4_H_
#define _MD4_H_
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
#include <stdint.h>
#define MD4_BLOCK_LENGTH 64
@@ -28,8 +31,6 @@ typedef struct MD4Context {
uint8_t buffer[MD4_BLOCK_LENGTH]; /* input buffer */
} MD4_CTX;
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
void MD4Init(MD4_CTX *);
void MD4Update(MD4_CTX *, const uint8_t *, size_t);
diff --git a/include/md5.h b/include/md5.h
index e6f151e..0a0a4ff 100644
--- a/include/md5.h
+++ b/include/md5.h
@@ -15,6 +15,9 @@
#ifndef _MD5_H_
#define _MD5_H_
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
#include <stdint.h>
#define MD5_BLOCK_LENGTH 64
@@ -27,8 +30,6 @@ typedef struct MD5Context {
uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
} MD5_CTX;
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
void MD5Init(MD5_CTX *);
void MD5Update(MD5_CTX *, const uint8_t *, size_t);
diff --git a/include/rmd160.h b/include/rmd160.h
index 3cda0b9..b9fef11 100644
--- a/include/rmd160.h
+++ b/include/rmd160.h
@@ -25,6 +25,9 @@
#ifndef _RMD160_H
#define _RMD160_H
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
#include <stdint.h>
#define RMD160_BLOCK_LENGTH 64
@@ -38,8 +41,6 @@ typedef struct RMD160Context {
uint8_t buffer[RMD160_BLOCK_LENGTH]; /* input buffer */
} RMD160_CTX;
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
void RMD160Init(RMD160_CTX *);
void RMD160Transform(uint32_t [5], const uint8_t [RMD160_BLOCK_LENGTH]);
diff --git a/include/sha1.h b/include/sha1.h
index c56cc1b..bf21e58 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -9,6 +9,9 @@
#ifndef _SHA1_H
#define _SHA1_H
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
#include <stdint.h>
#define SHA1_BLOCK_LENGTH 64
@@ -21,8 +24,6 @@ typedef struct {
uint8_t buffer[SHA1_BLOCK_LENGTH];
} SHA1_CTX;
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
void SHA1Init(SHA1_CTX *);
void SHA1Pad(SHA1_CTX *);
diff --git a/include/sha2.h b/include/sha2.h
index 631e6ae..9cfd273 100644
--- a/include/sha2.h
+++ b/include/sha2.h
@@ -37,6 +37,9 @@
#ifndef _SHA2_H
#define _SHA2_H
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
#include <stdint.h>
/*** SHA-256/384/512 Various Length Definitions ***********************/
@@ -61,8 +64,6 @@ typedef struct _SHA2_CTX {
uint8_t buffer[SHA512_BLOCK_LENGTH];
} SHA2_CTX;
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
void SHA256Init(SHA2_CTX *);
void SHA256Transform(uint32_t state[8], const uint8_t [SHA256_BLOCK_LENGTH]);