[llvm] r265109 - Fix S390 big endian detection

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 22:12:25 PDT 2016


Author: mehdi_amini
Date: Fri Apr  1 00:12:24 2016
New Revision: 265109

URL: http://llvm.org/viewvc/llvm-project?rev=265109&view=rev
Log:
Fix S390 big endian detection

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/lib/Support/SHA1.cpp

Modified: llvm/trunk/lib/Support/SHA1.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SHA1.cpp?rev=265109&r1=265108&r2=265109&view=diff
==============================================================================
--- llvm/trunk/lib/Support/SHA1.cpp (original)
+++ llvm/trunk/lib/Support/SHA1.cpp Fri Apr  1 00:12:24 2016
@@ -13,13 +13,14 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/Support/Host.h"
 #include "llvm/Support/SHA1.h"
 using namespace llvm;
 
 #include <stdint.h>
 #include <string.h>
 
-#ifdef __BIG_ENDIAN__
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
 #define SHA_BIG_ENDIAN
 #endif
 
@@ -113,7 +114,7 @@ void SHA1::update(ArrayRef<uint8_t> Data
 }
 
 void SHA1::pad() {
-  // Implement SHA-1 padding (fips180-2 §5.1.1)
+  // Implement SHA-1 padding (fips180-2 5.1.1)
 
   // Pad with 0x80 followed by 0x00 until the end of the block
   addUncounted(0x80);




More information about the llvm-commits mailing list