Skip to content

Commit 129aca2

Browse files
committed
Fix softfloat integration build failure on macOS/Arm64
Addressed compilation errors on macOS/Arm64 arising from conflicts between SoftFloat and SDL headers. The solution involves explicitly defining the conflicting types in SoftFloat to avoid clashes.
1 parent f237cec commit 129aca2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/riscv.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
#include <stdbool.h>
88
#include <stdint.h>
99
#if RV32_HAS(EXT_F)
10+
#define float16_t softfloat_float16_t
11+
#define bfloat16_t softfloat_bfloat16_t
12+
#define float32_t softfloat_float32_t
13+
#define float64_t softfloat_float64_t
1014
#include "softfloat/softfloat.h"
15+
#undef float16_t
16+
#undef bfloat16_t
17+
#undef float32_t
18+
#undef float64_t
1119
#endif
1220

1321
#ifdef __cplusplus
@@ -93,7 +101,7 @@ typedef uint16_t riscv_half_t;
93101
typedef uint8_t riscv_byte_t;
94102
typedef uint32_t riscv_exception_t;
95103
#if RV32_HAS(EXT_F)
96-
typedef float32_t riscv_float_t;
104+
typedef softfloat_float32_t riscv_float_t;
97105
#endif
98106

99107
/* memory read handlers */

0 commit comments

Comments
 (0)