C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
authorPeter Simons <simons@cryp.to>
Tue, 21 Jul 2009 13:22:24 +0000 (15:22 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 22 Jul 2009 13:16:35 +0000 (15:16 +0200)
* lib/md2.h [__cplusplus]: Wrap declarations in extern "C" scope.
* lib/md4.h: Likewise.
* lib/md5.h: Likewise.
* lib/sha1.h: Likewise.
* lib/sha256.h: Likewise.
* lib/sha512.h: Likewise.

ChangeLog
lib/md2.h
lib/md4.h
lib/md5.h
lib/sha1.h
lib/sha256.h
lib/sha512.h

index 718af87ed182fb28c280c86f1c48454ddcb394d8..cca4ce95c50f7c5edc6e8e82b9928a5928e5b883 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-07-22  Peter Simons  <simons@cryp.to>
 
+       C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
+       * lib/md2.h [__cplusplus]: Wrap declarations in extern "C" scope.
+       * lib/md4.h: Likewise.
+       * lib/md5.h: Likewise.
+       * lib/sha1.h: Likewise.
+       * lib/sha256.h: Likewise.
+       * lib/sha512.h: Likewise.
+
        tests-sha1: don't assign literal string to 'char *' variable
        * tests/test-sha1.c (main): Declare locals with "const" to match
        attributes of the right hand side.
index 401604ef1a1f9572718acdc7f062646e9c8abd67..3535e29dde5323dca4336e15cda47fed7f8df3b2 100644 (file)
--- a/lib/md2.h
+++ b/lib/md2.h
 # include <stdio.h>
 # include <stddef.h>
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 # define MD2_DIGEST_SIZE 16
 
 /* Structure to save state of computation between the single steps.  */
@@ -73,4 +77,8 @@ extern int md2_stream (FILE *stream, void *resblock);
    digest.  */
 extern void *md2_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
index 937794c3c019de29106faf33aa45c5b23760b6d6..6b49da50eedb952c9f9f2bc2c87be6a2ce6033dd 100644 (file)
--- a/lib/md4.h
+++ b/lib/md4.h
 # include <stdio.h>
 # include <stdint.h>
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 # define MD4_DIGEST_SIZE 16
 
 /* Structure to save state of computation between the single steps.  */
@@ -79,4 +83,8 @@ extern int md4_stream (FILE * stream, void *resblock);
    digest.  */
 extern void *md4_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
index 3ae657bb3ab46809c469b038c55a2df65074f233..0769edbaf3f00fb4450decef53076fe4c64e8036 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
 # define __md5_stream md5_stream
 #endif
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* Structure to save state of computation between the single steps.  */
 struct md5_ctx
 {
@@ -115,4 +119,8 @@ extern int __md5_stream (FILE *stream, void *resblock) __THROW;
 extern void *__md5_buffer (const char *buffer, size_t len,
                           void *resblock) __THROW;
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif /* md5.h */
index 4ffda7a994bea081aea464a698eb50e402cf365e..93babd2eed45e36e98c79ee8534a681fae2e9331 100644 (file)
 # include <stdio.h>
 # include <stdint.h>
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 #define SHA1_DIGEST_SIZE 20
 
 /* Structure to save state of computation between the single steps.  */
@@ -81,4 +85,8 @@ extern int sha1_stream (FILE *stream, void *resblock);
    digest.  */
 extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
index a63b2015d80c85069cbd46a1b78ff1a6940659b7..3dfcb264e842ce4058f049ba984a49bab55edbfd 100644 (file)
 # include <stdio.h>
 # include <stdint.h>
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* Structure to save state of computation between the single steps.  */
 struct sha256_ctx
 {
@@ -80,4 +84,8 @@ extern int sha224_stream (FILE *stream, void *resblock);
 extern void *sha256_buffer (const char *buffer, size_t len, void *resblock);
 extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
index ed12d545c2119ad05d134f2eb7db519620ae85d9..20bb09bed833944fdbda49691a844a8fc9dc72a5 100644 (file)
 
 # include "u64.h"
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 /* Structure to save state of computation between the single steps.  */
 struct sha512_ctx
 {
@@ -84,4 +88,8 @@ extern int sha384_stream (FILE *stream, void *resblock);
 extern void *sha512_buffer (const char *buffer, size_t len, void *resblock);
 extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif