Skip to content

Commit

Permalink
Avoid redefinition of __USE_POSIX199309/_POSIX_C_SOURCE
Browse files Browse the repository at this point in the history
On glibc systems, they are already defined in <features.h> which is
pulled in by any system header. Defining such macros in header files is
too late.
  • Loading branch information
th-otto authored and OmniBlade committed Mar 25, 2024
1 parent dcfe358 commit 52a10bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/mssleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#elif defined(_WIN32)
#include <synchapi.h>
#else /* Assuming recent posix*/
#define __USE_POSIX199309
#ifndef __USE_POSIX199309
#define __USE_POSIX199309 1
#endif
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199309L
#endif
#include <time.h>
#endif

Expand Down

0 comments on commit 52a10bc

Please sign in to comment.