Bug#816334: libserialport: FTBFS[!linux]: missing _DEFAULT_SOURCE
Package: libserialport
Version: 0.1.0-1
Severity: important
Tags: patch
Hi,
libserialport FTBFS in up-to-date sid. Perhaps some recent cleanup of
glibc headers triggered this, but there was a pre-existing issue here
in libserialport_internal.h:
25 #ifdef __linux__
26 /* For timeradd, timersub, timercmp. */
27 #define _BSD_SOURCE 1 /* for glibc < 2.19 */
28 #define _DEFAULT_SOURCE 1 /* for glibc >= 2.20 */
29 #endif
What really should be tested for is __GLIBC__, not the kernel. With
the attached patch, this compiles again on kfreebsd, and probably hurd
as well. Thank you!
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 10.1-0-amd64
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- a/libserialport_internal.h 2016-01-27 14:12:27.000000000 +0000
+++ b/libserialport_internal.h 2016-02-29 23:30:51.701109454 +0000
@@ -22,7 +22,7 @@
#define LIBSERIALPORT_LIBSERIALPORT_INTERNAL_H
-#ifdef __linux__
+#ifdef __GLIBC__
/* For timeradd, timersub, timercmp. */
#define _BSD_SOURCE 1 /* for glibc < 2.19 */
#define _DEFAULT_SOURCE 1 /* for glibc >= 2.20 */
Reply to: