diff --git a/fix-riscv64-compile-uintptr.patch b/fix-riscv64-compile-uintptr.patch new file mode 100644 index 0000000..d00bb5d --- /dev/null +++ b/fix-riscv64-compile-uintptr.patch @@ -0,0 +1,13 @@ +diff --git a/stb_sprintf.h b/stb_sprintf.h +index ca432a6..fb49e4d 100644 +--- a/stb_sprintf.h ++++ b/stb_sprintf.h +@@ -230,7 +230,7 @@ STBSP__PUBLICDEC void STB_SPRINTF_DECORATE(set_separators)(char comma, char peri + #define stbsp__uint16 unsigned short + + #ifndef stbsp__uintptr +-#if defined(__ppc64__) || defined(__powerpc64__) || defined(__aarch64__) || defined(_M_X64) || defined(__x86_64__) || defined(__x86_64) || defined(__s390x__) ++#if defined(__ppc64__) || defined(__powerpc64__) || defined(__aarch64__) || defined(_M_X64) || defined(__x86_64__) || defined(__x86_64) || defined(__s390x__) || defined(__LP64__) || (defined(__riscv) && __riscv_xlen == 64) + #define stbsp__uintptr stbsp__uint64 + #else + #define stbsp__uintptr stbsp__uint32 diff --git a/stb.spec b/stb.spec index 1acf709..478e95e 100644 --- a/stb.spec +++ b/stb.spec @@ -183,6 +183,11 @@ Patch: 0001-Fix-Null-pointer-dereference-because-of-an-uninitial.patch # https://github.com/nothings/stb/issues/1552 Patch: %{url}/pull/1553.patch + +# riscv64 compile fix +# https://github.com/nothings/stb/pull/1610 +Patch: fix-riscv64-compile-uintptr.patch + %global stb_c_lexer_version 0.12 %global stb_connected_components_version 0.96 %global stb_divide_version 0.94