From 592cfe5a2054b43cb37daf7c6188ba1c643e9d04 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Sat, 20 Apr 2024 10:50:44 -0400 Subject: [PATCH] Use "uint32_t" if we have for MD5 code. --- configure.in | 2 +- src/config.h.in | 3 +++ src/md5.h | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 2641f2f5..5e5ee6b9 100644 --- a/configure.in +++ b/configure.in @@ -30,7 +30,7 @@ AC_PATH_PROG([PERL], [perl]) dnl Checks for libraries. AC_CHECK_LIB(m, sqrt) -AC_CHECK_HEADERS_ONCE([sys/time.h]) +AC_CHECK_HEADERS_ONCE([sys/time.h stdint.h]) dnl Integer sizes AC_CHECK_SIZEOF(unsigned int) diff --git a/src/config.h.in b/src/config.h.in index d6e85b08..a0de85f0 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -10,6 +10,9 @@ /* Define if you have the header file */ #undef HAVE_GLOB_H +/* Define if you have */ +#undef HAVE_STDINT_H + #undef HAVE_WCTYPE_H #undef HAVE_LOCALE_H diff --git a/src/md5.h b/src/md5.h index 525a45e9..495f02b3 100644 --- a/src/md5.h +++ b/src/md5.h @@ -6,6 +6,10 @@ #include "config.h" +#ifdef HAVE_STDINT_H +#include +typedef uint32_t uint32; +#else #if SIZEOF_UNSIGNED_INT == 4 typedef unsigned int uint32; #elif SIZEOF_UNSIGNED_LONG == 4 @@ -13,6 +17,7 @@ typedef unsigned long uint32; #else # error Could not find a 32-bit integer type #endif +#endif struct MD5Context { uint32 buf[4]; @@ -26,9 +31,4 @@ void MD5Update(struct MD5Context *context, unsigned char const *buf, void MD5Final(unsigned char digest[16], struct MD5Context *context); void MD5Transform(uint32 buf[4], uint32 const in[16]); -/* - * This is needed to make RSAREF happy on some MS-DOS compilers. - */ -typedef struct MD5Context MD5_CTX; - #endif /* !MD5_H */