avoid using libc's internal sys/cdefs.h
authorImre Kaloz <kaloz@openwrt.org>
Wed, 29 Apr 2015 12:49:58 +0000 (14:49 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 1 May 2015 16:13:00 +0000 (18:13 +0200)
sha1.h simply shouldn't use it while sha1.c simply doesn't

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
sha1.c
sha1.h

diff --git a/sha1.c b/sha1.c
index 1db9134a45368d68f71900117bf7147c6d1b3294..e2e29cf498312e061d6ca42402e12c55c4844e56 100644 (file)
--- a/sha1.c
+++ b/sha1.c
@@ -17,7 +17,6 @@
 
 #define SHA1HANDSOFF           /* Copies data before messing with it. */
 
-#include <sys/cdefs.h>
 #include <sys/types.h>
 #include <assert.h>
 #include <string.h>
diff --git a/sha1.h b/sha1.h
index 13328d3a3bc4008cf5a7818e593b325c44e5c0df..80f6c2dfa426da73507ce9594110462c1d6b05a0 100644 (file)
--- a/sha1.h
+++ b/sha1.h
@@ -10,7 +10,6 @@
 #define        _SYS_SHA1_H_
 
 #include <sys/types.h>
-#include <sys/cdefs.h>
 #include <stdint.h>
 
 #define SHA1_DIGEST_LENGTH             20
@@ -22,11 +21,15 @@ typedef struct {
        u_char buffer[64];
 } SHA1_CTX;
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 void   SHA1Transform(uint32_t[5], const u_char[64]);
 void   SHA1Init(SHA1_CTX *);
 void   SHA1Update(SHA1_CTX *, const u_char *, u_int);
 void   SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _SYS_SHA1_H_ */