Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 firebird3.0 (3.0.5.33100.ds4-2) unstable; urgency=medium
 .
   * rules: fail if unable to determine ICU version.
   * rules: deremine ICU version via pkg-config
     Closes: #921683, thanks to Matthias Klose
Author: Damyan Ivanov <dmn@debian.org>
Bug-Debian: https://bugs.debian.org/921683

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2020-10-14

--- firebird3.0-3.0.5.33100.ds4.orig/src/common/classes/DbImplementation.cpp
+++ firebird3.0-3.0.5.33100.ds4/src/common/classes/DbImplementation.cpp
@@ -50,6 +50,7 @@ static const UCHAR CpuArm64 = 15;
 static const UCHAR CpuPowerPc64el = 16;
 static const UCHAR CpuM68k = 17;
 static const UCHAR CpuRiscV64 = 18;
+static const UCHAR CpuLoongarch64 = 19;
 
 static const UCHAR OsWindows = 0;
 static const UCHAR OsLinux = 1;
--- firebird3.0-3.0.5.33100.ds4.orig/src/common/common.h
+++ firebird3.0-3.0.5.33100.ds4/src/common/common.h
@@ -144,6 +144,10 @@
 #define RISC_ALIGNMENT
 #endif /* sparc */
 
+#ifdef _LOONGARCH_ARCH
+#define FB_CPU CpuLoongarch64
+#endif /* loongarch64 */
+
 #ifdef MIPSEL
 #define FB_CPU CpuMipsel
 #endif /* mipsel */
@@ -916,7 +920,7 @@ void GDS_breakpoint(int);
 // ASF: Currently, all little-endian are FB_SWAP_DOUBLE and big-endian aren't.
 // AP: Define it for your hardware correctly in case your CPU do not follow mentioned rule.
 //     The follwoing lines are kept for reference only.
-//#if defined(i386) || defined(I386) || defined(_M_IX86) || defined(AMD64) || defined(ARM) || defined(MIPSEL) || defined(DARWIN64) || defined(IA64)
+//#if defined(i386) || defined(I386) || defined(_M_IX86) || defined(AMD64) || defined(ARM) || defined(_LOONGARCH_ARCH) || defined(MIPSEL) || defined(DARWIN64) || defined(IA64)
 //#define		FB_SWAP_DOUBLE 1
 //#elif defined(sparc) || defined(PowerPC) || defined(PPC) || defined(__ppc__) || defined(HPUX) || defined(MIPS) || defined(__ppc64__)
 //#define		FB_SWAP_DOUBLE 0
