error: use of undeclared identifier 'CLOCK_MONOTONIC'
A lightweight file manager for X
Brought to you by:
baudinr
xfe 1.42 builds fine on macOS 10.12 but fails to build on OS X 10.11 and earlier with:
../st/st.c:979:3: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
clock_gettime(CLOCK_MONOTONIC, &now);
^
../st/st.c:979:17: error: use of undeclared identifier 'CLOCK_MONOTONIC'
clock_gettime(CLOCK_MONOTONIC, &now);
^
../st/st.c:4032:16: error: use of undeclared identifier 'CLOCK_MONOTONIC'
clock_gettime(CLOCK_MONOTONIC, &last);
^
../st/st.c:4057:17: error: use of undeclared identifier 'CLOCK_MONOTONIC'
clock_gettime(CLOCK_MONOTONIC, &now);
^
1 warning and 3 errors generated.
make[2]: *** [../st/st.o] Error 1
Here's a full build log:
I managed to install MaOSX in a virtual machine, but how do you compile Xfe in this system? Do you have some instructions to share?
Thanks.
I got this error when compiling with gcc-13 (on openSUSE Leap 15.6) using C standard "c11"
On invoking gcc-13 with -std=gnu11, this error did not arise.
It seems that gnu11 pulls in some extra defines that are not included with just c11.