libs/nixio: protect splice calls with ifdef SPLICE_F_MOVE, fixes compile error with...
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 27 Aug 2009 01:23:08 +0000 (01:23 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 27 Aug 2009 01:23:08 +0000 (01:23 +0000)
libs/nixio/src/splice.c

index 0704dfd..fe56661 100644 (file)
 #endif
 
 #ifdef _GNU_SOURCE
+#ifdef SPLICE_F_MOVE
 
 /* guess what sucks... */
 #ifdef __UCLIBC__
 #include <unistd.h>
 #include <sys/syscall.h>
+
 ssize_t splice(int __fdin, __off64_t *__offin, int __fdout,
         __off64_t *__offout, size_t __len, unsigned int __flags) {
 #ifdef __NR_splice
@@ -116,6 +118,7 @@ static int nixio_splice_flags(lua_State *L) {
        return 1;
 }
 
+#endif /* SPLICE_F_MOVE */
 #endif /* _GNU_SOURCE */
 
 /**
@@ -155,9 +158,11 @@ static int nixio_sendfile(lua_State *L) {
 /* module table */
 static const luaL_reg R[] = {
 #ifdef _GNU_SOURCE
+#ifdef SPLICE_F_MOVE
        {"splice",                      nixio_splice},
        {"splice_flags",        nixio_splice_flags},
 #endif
+#endif
        {"sendfile",            nixio_sendfile},
        {NULL,                  NULL}
 };