From: Wolfram Sang Date: Mon, 28 Dec 2015 13:33:40 +0000 (+0100) Subject: libserialport_internal: use new macro to enable timeradd, etc. X-Git-Tag: libserialport-0.1.1~8 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4d8195fe3f8b5d2a206b8c1c1edeb4e3e0208ccb;p=libserialport.git libserialport_internal: use new macro to enable timeradd, etc. Since glibc 2.20, the usage of _BSD_SOURCE is deprecated. Fix it like described here: https://sourceware.org/glibc/wiki/Release/2.20#Deprecation_of__BSD_SOURCE_and__SVID_SOURCE_feature_macros This fixes bug #716. Signed-off-by: Wolfram Sang --- diff --git a/libserialport_internal.h b/libserialport_internal.h index a0d872b..669152b 100644 --- a/libserialport_internal.h +++ b/libserialport_internal.h @@ -23,7 +23,9 @@ #ifdef __linux__ -#define _BSD_SOURCE /* For timeradd, timersub, timercmp. */ +/* For timeradd, timersub, timercmp. */ +#define _BSD_SOURCE 1 /* for glibc < 2.19 */ +#define _DEFAULT_SOURCE 1 /* for glibc >= 2.20 */ #endif #include