From 635857831767f2bdf33af26fda521681380cede7 Mon Sep 17 00:00:00 2001
From: wzx <wuzx1226@qq.com>
Date: Tue, 25 Oct 2022 16:15:28 +0800
Subject: [PATCH] Add sw64 architecture

Add sw64 architecture in file configure.ac brg_endian.h and crypt_blowfish.c to support sw64 architecture.

Signed-off-by: wzx <wuzx1226@qq.com>
---
 configure.ac                           | 3 +++
 ext/hash/sha3/generic64lc/brg_endian.h | 3 ++-
 ext/standard/crypt_blowfish.c          | 2 +-
 5 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 92464a7d..1f1f2af5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -193,6 +193,9 @@ dnl ----------------------------------------------------------------------------
 
 dnl See bug #28605
 case $host_cpu in
+  sw_64*)
+      CFLAGS="$CFLAGS -mieee"
+    ;;
   alpha*)
     if test "$GCC" = "yes"; then
       CFLAGS="$CFLAGS -mieee"
diff --git a/ext/hash/sha3/generic64lc/brg_endian.h b/ext/hash/sha3/generic64lc/brg_endian.h
index 7226eb3b..6c6bd823 100644
--- a/ext/hash/sha3/generic64lc/brg_endian.h
+++ b/ext/hash/sha3/generic64lc/brg_endian.h
@@ -111,7 +111,8 @@
       defined( __i386__ )  || defined( _M_I86 )  || defined( _M_IX86 )    || \
       defined( __OS2__ )   || defined( sun386 )  || defined( __TURBOC__ ) || \
       defined( vax )       || defined( vms )     || defined( VMS )        || \
-      defined( __VMS )     || defined( _M_X64 )
+      defined( __VMS )     || defined( _M_X64 )  || \
+      defined( __sw_64__ ) || defined( __sw_64 )
 #  define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
 
 #elif defined( AMIGA )   || defined( applec )    || defined( __AS400__ )  || \
diff --git a/ext/standard/crypt_blowfish.c b/ext/standard/crypt_blowfish.c
index 3806a290..9a4aba34 100644
--- a/ext/standard/crypt_blowfish.c
+++ b/ext/standard/crypt_blowfish.c
@@ -53,7 +53,7 @@
 /* Just to make sure the prototypes match the actual definitions */
 #include "crypt_blowfish.h"
 
-#if defined(__i386__) || defined(__x86_64__) || defined(__alpha__) || defined(__hppa__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__alpha__) || defined(__sw_64__) || defined(__hppa__)
 #define BF_SCALE			1
 #else
 #define BF_SCALE			0
-- 
2.33.0

