Hi, I have attached a patch for making neko compile on GNU/kFreeBSD
(thanks to Cyril Brulebois).

Cheers,
/JP
-- 
                                                    Jens Peter Secher.
_DD6A 05B0 174E BFB2 D4D9 B52E 0EE5 978A FE63 E8A1 jpsecher gmail com_.
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?
diff -urNad neko-1.5.3~/libs/std/socket.c neko-1.5.3/libs/std/socket.c
--- neko-1.5.3~/libs/std/socket.c	2007-01-28 22:34:36.000000000 +0100
+++ neko-1.5.3/libs/std/socket.c	2007-03-10 15:31:24.000000000 +0100
@@ -45,7 +45,7 @@
 #	define INVALID_SOCKET (-1)
 #endif
 
-#ifndef NEKO_LINUX
+#if !defined(NEKO_LINUX) && !defined(NEKO_GNUKFREEBSD)
 #	define MSG_NOSIGNAL 0
 #endif
 
@@ -397,7 +397,7 @@
 			tt = &tval;
 		}
 		if( select((int)(n+1),ra,wa,ea,tt) == SOCKET_ERROR ) {
-#			if defined(NEKO_LINUX) || defined(NEKO_MAC)
+#			if defined(NEKO_LINUX) || defined(NEKO_MAC) || defined(NEKO_GNUKFREEBSD)
 			if( errno == EINTR )
 				continue;
 #			endif
diff -urNad neko-1.5.3~/libs/std/sys.c neko-1.5.3/libs/std/sys.c
--- neko-1.5.3~/libs/std/sys.c	2007-01-28 22:34:36.000000000 +0100
+++ neko-1.5.3/libs/std/sys.c	2007-03-10 15:32:08.000000000 +0100
@@ -167,6 +167,8 @@
 	return alloc_string("BSD");
 #elif defined(NEKO_MAC)
 	return alloc_string("Mac");
+#elif defined(NEKO_GNUKFREEBSD)
+	return alloc_string("GNU/kFreeBSD");
 #else
 #error Unknow system string
 #endif
diff -urNad neko-1.5.3~/vm/jit_x86.c neko-1.5.3/vm/jit_x86.c
--- neko-1.5.3~/vm/jit_x86.c	2007-01-28 22:34:39.000000000 +0100
+++ neko-1.5.3/vm/jit_x86.c	2007-03-10 15:32:54.000000000 +0100
@@ -23,7 +23,7 @@
 #include <math.h>
 #include <stdio.h>
 
-#ifdef NEKO_LINUX
+#if defined(NEKO_LINUX) || defined(NEKO_GNUKFREEBSD)
 #	include <sys/types.h>
 #	include <sys/mman.h>
 #	define USE_MMAP
diff -urNad neko-1.5.3~/vm/main.c neko-1.5.3/vm/main.c
--- neko-1.5.3~/vm/main.c	2007-03-04 14:00:16.000000000 +0100
+++ neko-1.5.3/vm/main.c	2007-03-10 15:34:02.000000000 +0100
@@ -27,7 +27,7 @@
 #	include <sys/param.h>
 #	include <mach-o/dyld.h>
 #endif
-#ifdef NEKO_LINUX
+#if defined(NEKO_LINUX) || defined(NEKO_GNUKFREEBSD)
 #	include <signal.h>
 #endif
 
@@ -179,7 +179,7 @@
 #	define _CrtSetDbgFlag(x)
 #endif
 
-#ifdef NEKO_LINUX
+#if defined(NEKO_LINUX) || defined(NEKO_GNUKFREEBSD)
 static void handle_signal( int signal ) {
 	val_throw(alloc_string("Segmentation fault"));
 }
@@ -193,7 +193,7 @@
 	neko_global_init(&vm);
 	vm = neko_vm_alloc(NULL);
 	neko_vm_select(vm);
-#	ifdef NEKO_LINUX
+#	if defined(NEKO_LINUX) || defined(NEKO_GNUKFREEBSD)
 	struct sigaction act;
 	act.sa_sigaction = NULL;
 	act.sa_handler = handle_signal;
diff -urNad neko-1.5.3~/vm/neko.h neko-1.5.3/vm/neko.h
--- neko-1.5.3~/vm/neko.h	2007-01-28 22:34:39.000000000 +0100
+++ neko-1.5.3/vm/neko.h	2007-03-10 15:34:36.000000000 +0100
@@ -30,6 +30,10 @@
 #	define NEKO_LINUX
 #endif
 
+#if defined(__FreeBSD_kernel__)
+#	define NEKO_GNUKFREEBSD
+#endif
+
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
 #	define NEKO_BSD
 #endif
-- 
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to