From 07d788da25395446f71f7ab9bca0661893d9809d Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Sat, 1 Jun 2024 14:22:41 +0300 Subject: [PATCH] Disable all instances of potential thread local storage. --- CMakeLists.txt | 2 +- quik_stbi.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a95aef4..82cad4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0) project(quik_stbi LANGUAGES C VERSION 1.0) if (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")) - add_compile_options(-static-libgcc -static-libstdc++) + add_compile_options(-static-libgcc -static-libstdc++ -fno-exceptions) endif() add_library(stbi SHARED "quik_stbi.c") diff --git a/quik_stbi.h b/quik_stbi.h index cd2b84b..521fe27 100644 --- a/quik_stbi.h +++ b/quik_stbi.h @@ -5,6 +5,9 @@ #define STBIDEF QEXTERN +#define STBI_NO_THREAD_LOCALS 1 +#define STBI_NO_FAILURE_STRINGS 1 +#define STBI_THREAD_LOCAL #include "stb/stb_image.h" #endif