From 296491e1c5084565494bccef203c6f85f7fbbb20 Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Sun, 6 Apr 2025 16:39:20 +0300 Subject: [PATCH] fix: build on newer linux distributions Newer linux distributions correctly define PR_XXX constants. For older ones we should include explicitly. Fixes https://github.com/microsoft/mimalloc/issues/1065 Signed-off-by: Roman Gershman --- src/prim/unix/prim.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/prim/unix/prim.c b/src/prim/unix/prim.c index ad6ca2a9..64c95d9e 100644 --- a/src/prim/unix/prim.c +++ b/src/prim/unix/prim.c @@ -31,10 +31,13 @@ terms of the MIT license. A copy of the license can be found in the file #if defined(__linux__) #include - #include // PR_SET_VMA - //#if defined(MI_NO_THP) #include // THP disable - //#endif + + // Pick up missing definitions from linux headers. + #if !defined(PR_SET_VMA) + #include // PR_SET_VMA + #endif + #if defined(__GLIBC__) #include // linux mmap flags #else