diff --git a/fitsio2.h b/fitsio2.h
index d2369cf..9301d39 100644
--- a/fitsio2.h
+++ b/fitsio2.h
@@ -151,6 +151,11 @@ extern int Fitsio_Pthread_Status;
 #    error "can't handle long size given by __riscv_xlen"
 #  endif
 
+#  elif defined(__loongarch64)
+
+#define BYTESWAPPED TRUE
+#define LONGSIZE 64
+
 /* ============================================================== */
 /*  the following are all 32-bit byteswapped platforms            */
 
