This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-fast-pbkdf2.git

commit 95df391d16e0d9519c6ffe5a20e90959a8dc82b9
Author: Namrata Bhave <[email protected]>
AuthorDate: Fri Jan 19 19:04:23 2024 +0530

    Fix the endianness detection
---
 c_src/fast_pbkdf2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/c_src/fast_pbkdf2.c b/c_src/fast_pbkdf2.c
index 680950e..8c05ea3 100644
--- a/c_src/fast_pbkdf2.c
+++ b/c_src/fast_pbkdf2.c
@@ -38,7 +38,7 @@
 
 static inline void write32_be(uint32_t n, uint8_t out[4])
 {
-#if defined(__GNUC__) && __GNUC__ >= 4 && __BYTE_ORDER == __LITTLE_ENDIAN
+#if defined(__GNUC__) && __GNUC__ >= 4 && __BYTE_ORDER__ == 
__ORDER_LITTLE_ENDIAN__
   *(uint32_t *)(out) = __builtin_bswap32(n);
 #else
   out[0] = (n >> 24) & 0xff;
@@ -50,7 +50,7 @@ static inline void write32_be(uint32_t n, uint8_t out[4])
 
 static inline void write64_be(uint64_t n, uint8_t out[8])
 {
-#if defined(__GNUC__) &&  __GNUC__ >= 4 && __BYTE_ORDER == __LITTLE_ENDIAN
+#if defined(__GNUC__) &&  __GNUC__ >= 4 && __BYTE_ORDER__ == 
__ORDER_LITTLE_ENDIAN__
   *(uint64_t *)(out) = __builtin_bswap64(n);
 #else
   write32_be((n >> 32) & 0xffffffff, out);

Reply via email to