Skip to content

Commit b4fc899

Browse files
committed
fixup??? mimalloc: adjust for building inside Git
There is not actually any need to include all of `git-compat-util.h`, now that the relevant parts were moved to `compat/posix.h`. It also fixes a compile problem with USE_MIMALLOC on Linux: the `skip_iprefix()` function needs to have the `tolower()` function defined already, but when included from `reftable/basics.c` that is not the case due to the peculiar #include chain. The symptom looks like this: In file included from compat/mimalloc/mimalloc.h:98, from ./compat/posix.h:180, from reftable/system.h:14, from reftable/basics.h:16, from reftable/basics.c:10: ./git-compat-util.h: In function ‘skip_iprefix’: ./git-compat-util.h:907:18: error: implicit declaration of function ‘tolower’ [-Werror=implicit-function-declaration] 907 | } while (tolower(*str++) == tolower(*prefix++)); | ^~~~~~~ ./git-compat-util.h:468:1: note: include ‘<ctype.h>’ or provide a declaration of ‘tolower’ 467 | #include "wrapper.h" +++ |+#include <ctype.h> 468 | This is easily fixed by including just `compat/posix.h` and not `git-compat-util.h` (since the latter #includes the former, this is essentially a nice scope reduction). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4fe1edd commit b4fc899

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/mimalloc/mimalloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ terms of the MIT license. A copy of the license can be found in the file
9595
// Includes
9696
// ------------------------------------------------------
9797

98-
#include "git-compat-util.h"
98+
#include "compat/posix.h"
9999

100100
#include <stdbool.h> // bool
101101
#include <stdint.h> // INTPTR_MAX

0 commit comments

Comments
 (0)