[BACK]Return to patch-src_lj__arch.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / lang / LuaJIT2 / patches

File: [cvs.NetBSD.org] / pkgsrc / lang / LuaJIT2 / patches / patch-src_lj__arch.h (download)

Revision 1.1, Sat Jun 2 20:01:21 2018 UTC (4 years, 8 months ago) by he
Branch: MAIN
CVS Tags: pkgsrc-2022Q4-base, pkgsrc-2022Q4, pkgsrc-2022Q3-base, pkgsrc-2022Q3, pkgsrc-2022Q2-base, pkgsrc-2022Q2, pkgsrc-2022Q1-base, pkgsrc-2022Q1, pkgsrc-2021Q4-base, pkgsrc-2021Q4, pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, HEAD

Fix the test for endianness on powerpc so that NetBSD/powerpc
isn't mis-categorized as little-endian only because _LITTLE_ENDIAN
is defined -- what matters on NetBSD is the value of _BYTE_ORDER.
Retain the old test in the #else clause.
Bump PKGREVISION.

$NetBSD: patch-src_lj__arch.h,v 1.1 2018/06/02 20:01:21 he Exp $

Fix the test for endianness so that NetBSD/powerpc isn't
mis-categorized as little-endian only because _LITTLE_ENDIAN
is defined -- what matters on NetBSD is the value of _BYTE_ORDER.

--- src/lj_arch.h.orig	2017-05-01 18:11:00.000000000 +0000
+++ src/lj_arch.h
@@ -339,12 +339,21 @@
 #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
 #error "No support for PowerPC CPUs without double-precision FPU"
 #endif
-#if defined(_LITTLE_ENDIAN)
-#error "No support for little-endian PowerPC"
+
+#if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN)
+# if (_BYTE_ORDER == _LITTLE_ENDIAN)
+#  error "No support for little-endian PowerPC"
+# endif
+#else
+# if defined(_LITTLE_ENDIAN)
+#  error "No support for little-endian PowerPC"
+# endif
 #endif
+
 #if defined(_LP64)
 #error "No support for PowerPC 64 bit mode"
 #endif
+
 #elif LJ_TARGET_MIPS
 #if defined(__mips_soft_float)
 #error "No support for MIPS CPUs without FPU"