From 6e490e979cf5cbb107b651010e2ddd984dcdcc5c Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 1 Jun 2012 10:45:23 +0200 Subject: src/sigs.c: Define "_BSD_SOURCE" and "__BSD_VISIBLE" SIGWINCH isn't POSIX-compatible and causes a compile error on several platforms, such as OpenBSD: sigs.c: In function 'generic_hdlr': sigs.c:63: error: 'SIGWINCH' undeclared (first use in this function) sigs.c:63: error: (Each undeclared identifier is reported only once sigs.c:63: error: for each function it appears in.) sigs.c: In function 'sigs_init': sigs.c:97: error: 'SIGWINCH' undeclared (first use in this function) *** Error code 1 Define "_BSD_SOURCE" explicitly in this compilation unit to enforce definition of the "SIGWINCH" constant. Also, set "__BSD_VISIBLE" to 1 since FreeBSD doesn't honor "_BSD_SOURCE". Signed-off-by: Lukas Fleischer --- src/sigs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/sigs.c b/src/sigs.c index 4f5d982..4cc01bf 100644 --- a/src/sigs.c +++ b/src/sigs.c @@ -34,6 +34,16 @@ * */ +#ifndef _BSD_SOURCE +/* Needed for SIGWINCH on OpenBSD. */ +#define _BSD_SOURCE +#endif + +#ifndef __BSD_VISIBLE +/* Needed for SIGWINCH on FreeBSD. */ +#define __BSD_VISIBLE 1 +#endif + #include #include #include -- cgit v1.2.3