Skip to content

Commit fb3519e

Browse files
committed
fix: build on c99 or -std=c99
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
1 parent 88a06eb commit fb3519e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ AS_IF([test "x$orig_CFLAGS" = "x"], [
2828
AX_APPEND_LINK_FLAGS(["$SCROT_FLAGS"])
2929
])
3030

31+
AX_APPEND_COMPILE_FLAGS("-D_XOPEN_SOURCE=700L")
32+
3133
# Checks for libraries.
3234
PKG_CHECK_MODULES([X11], [x11])
3335
PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite])

0 commit comments

Comments
 (0)