diff --git a/README.md b/README.md index 9c86531e..87796081 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,8 @@ information on what to include when reporting a bug. - [X11] Bugfix: Decorations could not be enabled after window creation (#1566) - [X11] Bugfix: Content scale fallback value could be inconsistent (#1578) - [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432) + - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled + - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [NSGL] Removed enforcement of forward-compatible flag for core contexts - [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer macOS versions (#1442) diff --git a/src/posix_time.c b/src/posix_time.c index 301cb958..ae3d5c78 100644 --- a/src/posix_time.c +++ b/src/posix_time.c @@ -27,8 +27,11 @@ // It is fine to use C99 in this file because it will not be built with VS //======================================================================== +#define _POSIX_C_SOURCE 199309L + #include "internal.h" +#include #include #include @@ -41,7 +44,7 @@ // void _glfwInitTimerPOSIX(void) { -#if defined(CLOCK_MONOTONIC) +#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) @@ -64,7 +67,7 @@ void _glfwInitTimerPOSIX(void) uint64_t _glfwPlatformGetTimerValue(void) { -#if defined(CLOCK_MONOTONIC) +#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) if (_glfw.timer.posix.monotonic) { struct timespec ts; diff --git a/src/wl_init.c b/src/wl_init.c index 3507c8cf..558ff8a8 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -26,6 +26,8 @@ // It is fine to use C99 in this file because it will not be built with VS //======================================================================== +#define _POSIX_C_SOURCE 199309L + #include "internal.h" #include @@ -38,6 +40,7 @@ #include #include #include +#include #include diff --git a/src/x11_init.c b/src/x11_init.c index d44d4e2a..2b7bc7f1 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -36,6 +36,7 @@ #include #include #include +#include // Translate an X11 key code to a GLFW key code.