OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / include / md5.h
index e357893..6da2fef 100644 (file)
@@ -27,6 +27,8 @@
 # include <limits.h>
 #endif
 
+#include "ansidecl.h"
+
 /* The following contortions are an attempt to use the C preprocessor
    to determine an unsigned integral type that is 32 bits wide.  An
    alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
 # include <sys/types.h>
 typedef u_int32_t md5_uint32;
 typedef uintptr_t md5_uintptr;
+#elif defined (HAVE_SYS_TYPES_H) && defined (HAVE_STDINT_H)
+#include <stdint.h>
+#include <sys/types.h>
+typedef uint32_t md5_uint32;
+typedef uintptr_t md5_uintptr;
 #else
 #  define INT_MAX_32_BITS 2147483647
 
@@ -70,6 +77,10 @@ typedef uintptr_t md5_uintptr;
 typedef unsigned long int md5_uintptr;
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Structure to save state of computation between the single steps.  */
 struct md5_ctx
 {
@@ -136,4 +147,8 @@ extern int md5_stream (FILE *stream, void *resblock);
    digest.  */
 extern void *md5_buffer (const char *buffer, size_t len, void *resblock);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif