Skip to content

Commit

Permalink
[Core] Ensure inline toupper/tolower (#1805)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebaszm authored Dec 6, 2024
1 parent 49ef0ef commit 50273c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/core/Portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ struct SEMAPHORE_BASIC_INFORMATION {
#endif

#ifdef __LINUX__
#include <ctype.h> // must be first for inline ::tolower() etc.

#include <cstddef>
#include <cstdint>
#include <cstdio>
Expand Down

0 comments on commit 50273c5

Please sign in to comment.