Include bsd/{string,unistd}.h if present.
authorEmil Mikulic <emikulic@gmail.com>
Thu, 1 Mar 2012 09:19:49 +0000 (20:19 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Thu, 1 Mar 2012 09:19:49 +0000 (20:19 +1100)
bsd.h
configure.ac

diff --git a/bsd.h b/bsd.h
index a25deb7..3426add 100644 (file)
--- a/bsd.h
+++ b/bsd.h
@@ -5,8 +5,13 @@
  */
 
 #include <sys/types.h>
-
 #include "config.h"
+#ifdef HAVE_BSD_STRING_H
+# include <bsd/string.h>
+#endif
+#ifdef HAVE_BSD_UNISTD_H
+# include <bsd/unistd.h>
+#endif
 
 #ifndef HAVE_STRLCPY
 size_t strlcpy(char *dst, const char *src, size_t siz);
index 0977e4c..aa7fd0c 100644 (file)
@@ -322,5 +322,8 @@ AC_SEARCH_LIBS(strlcat, [bsd],
  AC_DEFINE(HAVE_STRLCAT, 1,
   [Define to 1 if you have strlcat().]))
 
+AC_CHECK_HEADERS(bsd/string.h)
+AC_CHECK_HEADERS(bsd/unistd.h)
+
 AC_CONFIG_FILES([Makefile darkstat.8])
 AC_OUTPUT