Skip to content

Commit 24e5fd3

Browse files
committed
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.
1 parent 87ec923 commit 24e5fd3

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

cmake/introspection.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ check_cxx_source_compiles("
5555

5656
# Check for posix_fallocate().
5757
check_cxx_source_compiles("
58-
// same as in src/util/fs_helpers.cpp
59-
#ifdef __linux__
60-
#ifdef _POSIX_C_SOURCE
61-
#undef _POSIX_C_SOURCE
62-
#endif
63-
#define _POSIX_C_SOURCE 200112L
64-
#endif // __linux__
6558
#include <fcntl.h>
6659
6760
int main()

src/util/fs_helpers.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@
2222
#include <utility>
2323

2424
#ifndef WIN32
25-
// for posix_fallocate, in cmake/introspection.cmake we check if it is present after this
26-
#ifdef __linux__
27-
28-
#ifdef _POSIX_C_SOURCE
29-
#undef _POSIX_C_SOURCE
30-
#endif
31-
32-
#define _POSIX_C_SOURCE 200112L
33-
34-
#endif // __linux__
35-
3625
#include <fcntl.h>
3726
#include <sys/resource.h>
3827
#include <unistd.h>

0 commit comments

Comments
 (0)