summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Kendrick (plinth) <rjek@rjek.com>2013-11-27 14:38:38 +0000
committerRob Kendrick (plinth) <rjek@rjek.com>2013-11-27 14:38:38 +0000
commited8f7d0d066f9d9b82801ede35dfb69133080817 (patch)
tree970431c16ffc68fa5fe70b58675edd1831340cb4
parent3b7f8babc8f2f8ef635b9fb3d44090f8c019a455 (diff)
downloadluxio-ed8f7d0d066f9d9b82801ede35dfb69133080817.tar.bz2
NetBSD
-rw-r--r--Makefile3
-rw-r--r--config.h6
-rw-r--r--luxio.c4
3 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2fa7ca4..fe6a84f 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,8 @@ endif
# This isn't nice. Find a nice way.
HOST_OS := $(shell uname -s)
-ifeq ($(HOST_OS),Linux)
+ifneq ($(findstring $(HOST_OS),Linux NetBSD),)
+ # These operating systems require a seperate Real Time library
EXTRA_LIBS := -lrt
else
EXTRA_LIBS :=
diff --git a/config.h b/config.h
index 68930dd..5d1bf50 100644
--- a/config.h
+++ b/config.h
@@ -18,6 +18,12 @@
# define _POSIX_C_SOURCE 1
#endif
+#ifdef __NetBSD__
+# define ICONV_IN_TYPE const char **
+#else
+# define ICONV_IN_TYPE char **
+#endif
+
#ifndef _POSIX_PTHREAD_SEMANTICS
/* Solaris horror */
# define _POSIX_PTHREAD_SEMANTICS 1
diff --git a/luxio.c b/luxio.c
index 4490121..3507464 100644
--- a/luxio.c
+++ b/luxio.c
@@ -3236,7 +3236,7 @@ luxio_iconv(lua_State *L)
luaL_buffinit(L, &b);
do {
- ret = iconv(cd, &inbuf, &ibleft, &outbuf, &obleft);
+ ret = iconv(cd, (ICONV_IN_TYPE)&inbuf, &ibleft, &outbuf, &obleft);
if (ret == (size_t)(-1)) {
luaL_addlstring(&b, outbufs, ICONV_BUF_SIZE - obleft);
@@ -3411,7 +3411,7 @@ luxio_functions[] = {
{ "nanosleep", luxio_nanosleep },
-#if defined(_POSIX_MESSAGE_PASSING) && defined(__linux__)
+#if defined(_POSIX_MESSAGE_PASSING)
#if _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L
{ "mq_timedsend", luxio_mq_timedsend },