Hi all,

In a drive-by bugreport on IRC, it was noted that the build is broken
on NetBSD due to the newly added feature macros.  This includes 4.12.0,
so I think the attached patch should go to master as well as chicken-5.

Cheers,
Peter
From 804ad0b66638d6016a2f25e8c5cad3424ff2d4aa Mon Sep 17 00:00:00 2001
From: Peter Bex <[email protected]>
Date: Sun, 9 Apr 2017 13:49:26 +0200
Subject: [PATCH] Add feature macro for NetBSD

NetBSD does not expose all of its own stuff with _BSD_SOURCE.  For
that, you also need _NETBSD_SOURCE.

Without this, "NSIG" (and probably other things too) is undefined,
because it's declared conditionally in sys/signal.h on _NETBSD_SOURCE.
---
 NEWS      | 3 +++
 chicken.h | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/NEWS b/NEWS
index ff3e8cd..df1af55 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,9 @@
   - Unit "posix": If file-lock, file-lock/blocking or file-unlock are
     interrupted by a signal, we now retry (thanks to Joerg Wittenberger).
 
+- Build system
+  - Fixed broken compilation on NetBSD, due to missing _NETBSD_SOURCE.
+
 
 4.12.0
 
diff --git a/chicken.h b/chicken.h
index 13e6947..4ecb52c 100644
--- a/chicken.h
+++ b/chicken.h
@@ -65,6 +65,10 @@
 #  define _BSD_SOURCE
 # endif
 
+# ifndef _NETBSD_SOURCE
+#  define _NETBSD_SOURCE
+# endif
+
 # ifndef _SVID_SOURCE
 #  define _SVID_SOURCE
 # endif
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to