0
0
mirror of https://github.com/darkk/redsocks.git synced 2025-08-30 21:55:31 +00:00

Switch from gnu99 to C99 and provide proper feature macros.

Use _XOPEN_SOURCE=600 to make system headers expose Single UNIX
Specification v3 (SUSv3) definitions, i.e. POSIX.1-2001 base
specification plus the X/Open System Interface (XSI) extension.
POSIX.1-2001 is aligned with C99, so that all of the library
functions standardized in C99 are also standardized in POSIX.1-2001.

Use _BSD_SOURCE together with _DEFAULT_SOURCE to compile without
warnings in glibc <= 2.19 and glibc >= 2.20 (_BSD_SOURCE is deprecated
since glibc 2.20 and it has same effect as defining _DEFAULT_SOURCE
but generates a compile-time warning if used alone). This is required
for availability of non-POSIX functions, like inet_aton() or timercmp(),
that are present on most BSD derivatives.

Note: _DEFAULT_SOURCE, which was introduced in glibc 2.19, will actually
bump _POSIX_C_SOURCE from 200112L to 200809L, but it brings no harm.
This commit is contained in:
Przemyslaw Pawelczyk 2014-07-05 01:28:44 +02:00
parent 19f0fb225a
commit a7d1fb09a0

View File

@ -7,7 +7,7 @@ VERSION := 0.4
LIBS := -levent
CFLAGS += -g -O2
override CFLAGS += -std=gnu99 -Wall
override CFLAGS += -std=c99 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -Wall
all: $(OUT)