resurrecting-open-source-projects / scrot

SCReenshOT - command line screen capture utility
Other
495 stars 49 forks source link

fix: build on c99 or -std=c99 #306

Closed N-R-K closed 1 year ago

N-R-K commented 1 year ago

currently scrot fails to build when either CC=c99 or CFLAGS contains -std=c99 because they disable _GNU_SOURCE feature-test-macro. to reproduce:

./autogen.sh && ./configure CC=c99 && make

or

./autogen.sh && ./configure CFLAGS="-std=c99" && make

we do not use any gnu c language extension, as such we should build fine under c99 or -std=c99

fix the build via appending -D_XOPEN_SOURCE=700L to the compile flags. which is equivalent to _POSIX_C_SOURCE=200809L except that it also unlocks the X/Open System Interfaces.

ref: https://man7.org/linux/man-pages/man7/feature_test_macros.7.html