From 24e5fd3bedcebacbc10f0449be61be636b77dd79 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 9 May 2025 11:43:00 +0100 Subject: [PATCH] fs: remove _POSIX_C_SOURCE defining On Linux systems, `_POSIX_C_SOURCE` will default to `200809L` (since glibc 2.10). There's currently no reason for us to undefine it, and then set it to an earlier value. Also tested with musl libc. I think if anything, the project should be settings macros like `_POSIX_C_SOURCE`, globally. --- cmake/introspection.cmake | 7 ------- src/util/fs_helpers.cpp | 11 ----------- 2 files changed, 18 deletions(-) diff --git a/cmake/introspection.cmake b/cmake/introspection.cmake index 0efcf7c63c7..9223129761f 100644 --- a/cmake/introspection.cmake +++ b/cmake/introspection.cmake @@ -55,13 +55,6 @@ check_cxx_source_compiles(" # Check for posix_fallocate(). check_cxx_source_compiles(" - // same as in src/util/fs_helpers.cpp - #ifdef __linux__ - #ifdef _POSIX_C_SOURCE - #undef _POSIX_C_SOURCE - #endif - #define _POSIX_C_SOURCE 200112L - #endif // __linux__ #include int main() diff --git a/src/util/fs_helpers.cpp b/src/util/fs_helpers.cpp index ec848155651..be7f1ee5a27 100644 --- a/src/util/fs_helpers.cpp +++ b/src/util/fs_helpers.cpp @@ -22,17 +22,6 @@ #include #ifndef WIN32 -// for posix_fallocate, in cmake/introspection.cmake we check if it is present after this -#ifdef __linux__ - -#ifdef _POSIX_C_SOURCE -#undef _POSIX_C_SOURCE -#endif - -#define _POSIX_C_SOURCE 200112L - -#endif // __linux__ - #include #include #include