From 1a6fd3f05f4ecbb702496638c3b682d024e61eda Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Tue, 23 Feb 2021 22:31:16 +0100 Subject: [PATCH] Set __IEEE_BIG_ENDIAN for big endian RISC-V --- newlib/libc/include/machine/ieeefp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h index 4dc13828c..3c1f41e03 100644 --- a/newlib/libc/include/machine/ieeefp.h +++ b/newlib/libc/include/machine/ieeefp.h @@ -199,7 +199,11 @@ #endif #ifdef __riscv +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +#define __IEEE_BIG_ENDIAN +#else #define __IEEE_LITTLE_ENDIAN +#endif #ifdef __riscv_flen # define _SUPPORTS_ERREXCEPT #endif -- 2.43.5