--- gambc-4.9.3.orig/include/gambit.h.in
+++ gambc-4.9.3/include/gambit.h.in
@@ -388,6 +388,23 @@
 
 #endif
 
+
+#ifndef ___CPU_loongarch
+#ifdef loongarch
+#define ___CPU_loongarch
+#else
+#ifdef __loongarch
+#define ___CPU_loongarch
+#else
+#ifdef __loongarch__
+#define ___CPU_loongarch
+#else
+#endif
+#endif
+#endif
+
+#endif
+
 #ifndef ___CPU_ia64
 
 #ifdef __ia64
@@ -475,6 +492,10 @@
 #define ___LITTLE_ENDIAN
 #endif
 
+#ifdef ___CPU_loongarch
+#define ___LITTLE_ENDIAN
+#endif
+
 #ifdef ___CPU_ia64
 #ifdef __BIG_ENDIAN__
 #define ___BIG_ENDIAN
