From 50273c52c64c80d410b016c3e84f2a26371cafc4 Mon Sep 17 00:00:00 2001 From: sebaszm <45654185+sebaszm@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:50:12 +0100 Subject: [PATCH] [Core] Ensure inline toupper/tolower (#1805) Some standard lib headers (e.g. stdlib.h) end up setting __NO_CTYPE. When ctype.h is processed with this flag different code is compiled, amongst others making toupper/tolower and some isxxx() not inline but calling extern functions (which is slower). Because of include guards to ensure the inlining, ctype.h must be the first header file included for a module. --- Source/core/Portability.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/core/Portability.h b/Source/core/Portability.h index 65a3fd146..9708cf97c 100644 --- a/Source/core/Portability.h +++ b/Source/core/Portability.h @@ -396,6 +396,8 @@ struct SEMAPHORE_BASIC_INFORMATION { #endif #ifdef __LINUX__ +#include // must be first for inline ::tolower() etc. + #include #include #include