]> sigrok.org Git - libserialport.git/commitdiff
libserialport_internal: use new macro to enable timeradd, etc.
authorWolfram Sang <redacted>
Mon, 28 Dec 2015 13:33:40 +0000 (14:33 +0100)
committerUwe Hermann <redacted>
Tue, 29 Dec 2015 00:16:28 +0000 (01:16 +0100)
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 <redacted>
libserialport_internal.h

index a0d872bb8ed8bd8f9f2b854470965a694a107089..669152b675339927e5b0dda0e993230c637fbe7c 100644 (file)
@@ -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 <string.h>