Skip to content

Commit 10d0616

Browse files
fix(rtextures): TCC not being able to compile due to: 'emmintrin.h' not found (#4707)
define STBIR_NO_SIMD when __TINYC__ is defined so stb_image_resize2 will not include *mmintrin which are not supported by all compilers. There are similar checks for __TINYC__ already elswere in raylib and they are also mostly there to disable SIMD headers. Additionally, move similar check for stb_image, to be a little bit deeper. Before it was defining STBI_NO_SIMD without including stb_image It was also clashing with note, causing said note to make no sense. Fixes: #2994 Reference: nothings/stb#1738
1 parent e70f915 commit 10d0616

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/rtextures.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,6 @@
124124
#endif
125125

126126
// Image fileformats not supported by default
127-
#if defined(__TINYC__)
128-
#define STBI_NO_SIMD
129-
#endif
130-
131127
#if (defined(SUPPORT_FILEFORMAT_BMP) || \
132128
defined(SUPPORT_FILEFORMAT_PNG) || \
133129
defined(SUPPORT_FILEFORMAT_TGA) || \
@@ -149,6 +145,10 @@
149145

150146
#define STBI_NO_THREAD_LOCALS
151147

148+
#if defined(__TINYC__)
149+
#define STBI_NO_SIMD
150+
#endif
151+
152152
#define STB_IMAGE_IMPLEMENTATION
153153
#include "external/stb_image.h" // Required for: stbi_load_from_file()
154154
// NOTE: Used to read image data (multiple formats support)
@@ -218,6 +218,9 @@
218218
#pragma GCC diagnostic ignored "-Wunused-function"
219219
#endif
220220

221+
#if defined(__TINYC__)
222+
#define STBIR_NO_SIMD
223+
#endif
221224
#define STB_IMAGE_RESIZE_IMPLEMENTATION
222225
#include "external/stb_image_resize2.h" // Required for: stbir_resize_uint8_linear() [ImageResize()]
223226

0 commit comments

Comments
 (0)