Commit a06744c7 authored by rswindell's avatar rswindell
Browse files

Use MD5CALL/MD5EXPORT instead of DLLCALL/DLLEXPORT to avoid confusion with

wrapdll.h.
parent 31642940
......@@ -34,7 +34,7 @@ documentation and/or software.
#define LITTLE_ENDIAN /* Little Endian by default */
#endif
void DLLCALL MD5_open(MD5 *md5)
void MD5CALL MD5_open(MD5 *md5)
{
md5->count[0] = md5->count[1] = 0;
/* Load magic initialization constants.*/
......@@ -194,7 +194,7 @@ static void MD5Transform(UINT4 state[4], const BYTE block[64])
memset(x, 0, sizeof(x));
}
void DLLCALL MD5_digest(MD5 *md5, const void *input, size_t inputLen)
void MD5CALL MD5_digest(MD5 *md5, const void *input, size_t inputLen)
{
unsigned int i, index, partLen;
/* Compute number of bytes mod 64 */
......@@ -229,7 +229,7 @@ void DLLCALL MD5_digest(MD5 *md5, const void *input, size_t inputLen)
#define ENCODE(p,n) (p)[0]=n,(p)[1]=n>>8,(p)[2]=n>>16,(p)[3]=n>>24
#endif
void DLLCALL MD5_close(MD5 *md5, BYTE digest[MD5_DIGEST_SIZE])
void MD5CALL MD5_close(MD5 *md5, BYTE digest[MD5_DIGEST_SIZE])
{
BYTE bits[8];
unsigned int index, padLen;
......@@ -257,7 +257,7 @@ void DLLCALL MD5_close(MD5 *md5, BYTE digest[MD5_DIGEST_SIZE])
memset(md5, 0, sizeof(MD5));
}
BYTE* DLLCALL MD5_calc(BYTE digest[MD5_DIGEST_SIZE], const void* buf, size_t len)
BYTE* MD5CALL MD5_calc(BYTE digest[MD5_DIGEST_SIZE], const void* buf, size_t len)
{
MD5 ctx;
......@@ -270,7 +270,7 @@ BYTE* DLLCALL MD5_calc(BYTE digest[MD5_DIGEST_SIZE], const void* buf, size_t len
/* conversion for 16 character binary md5 to hex */
BYTE* DLLCALL MD5_hex(BYTE* to, const BYTE digest[MD5_DIGEST_SIZE])
BYTE* MD5CALL MD5_hex(BYTE* to, const BYTE digest[MD5_DIGEST_SIZE])
{
BYTE const* from = digest;
static char *hexdigits = "0123456789abcdef";
......
......@@ -50,27 +50,20 @@ typedef struct
BYTE buffer[64];
} MD5;
#if defined(DLLEXPORT)
#undef DLLEXPORT
#endif
#if defined(DLLCALL)
#undef DLLCALL
#endif
#if defined(_WIN32) && (defined(MD5_IMPORTS) || defined(MD5_EXPORTS))
#if defined(MD5_IMPORTS)
#define DLLEXPORT __declspec(dllimport)
#define MD5EXPORT __declspec(dllimport)
#else
#define DLLEXPORT __declspec(dllexport)
#define MD5EXPORT __declspec(dllexport)
#endif
#if defined(__BORLANDC__)
#define DLLCALL __stdcall
#define MD5CALL __stdcall
#else
#define DLLCALL
#define MD5CALL
#endif
#else /* !_WIN32 || !_DLL*/
#define DLLEXPORT
#define DLLCALL
#else /* !_WIN32 */
#define MD5EXPORT
#define MD5CALL
#endif
......@@ -78,11 +71,11 @@ typedef struct
extern "C" {
#endif
DLLEXPORT void DLLCALL MD5_open(MD5* ctx);
DLLEXPORT void DLLCALL MD5_digest(MD5* ctx, const void* buf, size_t len);
DLLEXPORT void DLLCALL MD5_close(MD5* ctx, BYTE digest[MD5_DIGEST_SIZE]);
DLLEXPORT BYTE* DLLCALL MD5_calc(BYTE digest[MD5_DIGEST_SIZE], const void* buf, size_t len);
DLLEXPORT BYTE* DLLCALL MD5_hex(BYTE* dest, const BYTE digest[MD5_DIGEST_SIZE]);
MD5EXPORT void MD5CALL MD5_open(MD5* ctx);
MD5EXPORT void MD5CALL MD5_digest(MD5* ctx, const void* buf, size_t len);
MD5EXPORT void MD5CALL MD5_close(MD5* ctx, BYTE digest[MD5_DIGEST_SIZE]);
MD5EXPORT BYTE* MD5CALL MD5_calc(BYTE digest[MD5_DIGEST_SIZE], const void* buf, size_t len);
MD5EXPORT BYTE* MD5CALL MD5_hex(BYTE* dest, const BYTE digest[MD5_DIGEST_SIZE]);
#ifdef __cplusplus
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment