2
0
Эх сурвалжийг харах

core: use in tree portable endianness macros

- replace WORDS_BIGENDIAN with __IS_BIG_ENDIAN
- not all platforms define WORDS_BIGENDIAN on big endian archs
- closes GH #739
Spencer Thomason 9 жил өмнө
parent
commit
72eed465dd
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      md5.c

+ 2 - 1
md5.c

@@ -20,6 +20,7 @@
 #include <sys/types.h>
 #include <sys/types.h>
 #include <string.h>
 #include <string.h>
 
 
+#include "endianness.h"
 #include "md5.h"
 #include "md5.h"
 
 
 #ifndef __OS_solaris
 #ifndef __OS_solaris
@@ -159,7 +160,7 @@ MD5Transform(u_int32_t state[4], const u_int8_t block[MD5_BLOCK_LENGTH])
 {
 {
 	u_int32_t a, b, c, d, in[MD5_BLOCK_LENGTH / 4];
 	u_int32_t a, b, c, d, in[MD5_BLOCK_LENGTH / 4];
 
 
-#ifndef WORDS_BIGENDIAN
+#ifndef __IS_BIG_ENDIAN
 	memcpy(in, block, sizeof(in));
 	memcpy(in, block, sizeof(in));
 #else
 #else
 	for (a = 0; a < MD5_BLOCK_LENGTH / 4; a++) {
 	for (a = 0; a < MD5_BLOCK_LENGTH / 4; a++) {