Explorar o código

try loading libneko.dylib on OSX

Nicolas Cannasse %!s(int64=13) %!d(string=hai) anos
pai
achega
060a72c5cf
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      interp.ml

+ 3 - 1
interp.ml

@@ -439,8 +439,10 @@ type neko_context = {
 }
 
 let neko =
-	let neko = Extc.dlopen (if Sys.os_type = "Win32" || Sys.os_type = "Cygwin" then "neko.dll" else "libneko.so") in
+	let is_win = Sys.os_type = "Win32" || Sys.os_type = "Cygwin" in
+	let neko = Extc.dlopen (if is_win then "neko.dll" else "libneko.so") in
 	let null = Extc.dlint 0 in
+	let neko = if Obj.magic neko == null && not is_win then Extc.dlopen "libneko.dylib" else neko in
 	if Obj.magic neko == null then
 		None
 	else