Move U64 macro from sha.h to sha512.c
authoravas <avas@devvm3802.prn2.facebook.com>
Thu, 5 Dec 2019 14:14:44 +0000 (06:14 -0800)
committerPauli <paul.dale@oracle.com>
Tue, 10 Dec 2019 04:37:58 +0000 (14:37 +1000)
Summary:
U64 is too common name for macro, being in public header sha.h it
conflicts with other projects (WAVM in my case). Moving macro from
public header to the only .c file using it.

CLA: trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10579)

crypto/sha/sha512.c
include/openssl/sha.h

index 03189a9d9c4420d36bdd7d31e7b5d01241adf0be..c70edf572ae236281e62f886afa8810214411cb5 100644 (file)
 # define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
 #endif
 
+#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+# define U64(C)     C##UI64
+#elif defined(__arch64__)
+# define U64(C)     C##UL
+#else
+# define U64(C)     C##ULL
+#endif
+
 int sha512_224_init(SHA512_CTX *c)
 {
     c->h[0] = U64(0x8c3d37c819544da2);
index e262ea37002591e00b001dcb761138ea2c0c8af1..be27e2c972427423b99fdc8c7f801936c6dc81a9 100644 (file)
@@ -89,13 +89,10 @@ void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
 # define SHA512_CBLOCK   (SHA_LBLOCK*8)
 # if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
 #  define SHA_LONG64 unsigned __int64
-#  define U64(C)     C##UI64
 # elif defined(__arch64__)
 #  define SHA_LONG64 unsigned long
-#  define U64(C)     C##UL
 # else
 #  define SHA_LONG64 unsigned long long
-#  define U64(C)     C##ULL
 # endif
 
 typedef struct SHA512state_st {