[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] lightning.h: Add workaround to define __powerpc__ if missing
From: |
Paul Cercueil |
Subject: |
[PATCH 1/2] lightning.h: Add workaround to define __powerpc__ if missing |
Date: |
Sat, 28 May 2022 14:26:44 +0100 |
Some C libraries / compilers won't define __powerpc__, but may define
__POWERPC__, __ppc__, or __PPC__. Notably, this happens on the PowerPC
builds of OSX.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
include/lightning.h.in | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/lightning.h.in b/include/lightning.h.in
index 2c540cb..887a951 100644
--- a/include/lightning.h.in
+++ b/include/lightning.h.in
@@ -123,6 +123,11 @@ typedef jit_int32_t jit_bool_t;
typedef jit_int32_t jit_gpr_t;
typedef jit_int32_t jit_fpr_t;
+#if !defined(__powerpc__) && \
+ (defined(__POWERPC__) || defined(__ppc__) || defined(__PPC__))
+#define __powerpc__ 1
+#endif
+
#if defined(__i386__) || defined(__x86_64__)
# include <lightning/jit_x86.h>
#elif defined(__mips__)
--
2.35.1
- [PATCH 1/2] lightning.h: Add workaround to define __powerpc__ if missing,
Paul Cercueil <=