Skip to content

Commit

Permalink
fix(rtextures): TCC not being able to compile due to: 'emmintrin.h' n…
Browse files Browse the repository at this point in the history
…ot 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
  • Loading branch information
sleeptightAnsiC authored Jan 19, 2025
1 parent e70f915 commit 10d0616
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/rtextures.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@
#endif

// Image fileformats not supported by default
#if defined(__TINYC__)
#define STBI_NO_SIMD
#endif

#if (defined(SUPPORT_FILEFORMAT_BMP) || \
defined(SUPPORT_FILEFORMAT_PNG) || \
defined(SUPPORT_FILEFORMAT_TGA) || \
Expand All @@ -149,6 +145,10 @@

#define STBI_NO_THREAD_LOCALS

#if defined(__TINYC__)
#define STBI_NO_SIMD
#endif

#define STB_IMAGE_IMPLEMENTATION
#include "external/stb_image.h" // Required for: stbi_load_from_file()
// NOTE: Used to read image data (multiple formats support)
Expand Down Expand Up @@ -218,6 +218,9 @@
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

#if defined(__TINYC__)
#define STBIR_NO_SIMD
#endif
#define STB_IMAGE_RESIZE_IMPLEMENTATION
#include "external/stb_image_resize2.h" // Required for: stbir_resize_uint8_linear() [ImageResize()]

Expand Down

0 comments on commit 10d0616

Please sign in to comment.