summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-08-08 19:10:07 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-08-08 19:10:07 +0200
commitf24fe15610e9d5bd3457bcb7567dc723672ffb04 (patch)
treee3bf1041836707583b729c504897b74742f113f7
parent249175b68c3cb9d9b146c3930ae62cb2712f8d1a (diff)
Fix the BSD/Darwin implementation of %FOREIGN-LAMBDA.
-rw-r--r--MLKInterpreter.m17
1 files changed, 7 insertions, 10 deletions
diff --git a/MLKInterpreter.m b/MLKInterpreter.m
index 2a85502..a98fb41 100644
--- a/MLKInterpreter.m
+++ b/MLKInterpreter.m
@@ -43,14 +43,16 @@
#import <Foundation/NSNull.h>
#import <Foundation/NSString.h>
-#ifndef _WIN32
-#include <dlfcn.h>
+#include <stdio.h>
+
+#ifdef _WIN32
+ #include <windows.h>
#else
-#include <windows.h>
+ #define _BSD_SOURCE
+ #undef _POSIX_C_SOURCE // needed at least on Mac OS X for RTLD_DEFAULT to be defined
+ #include <dlfcn.h>
#endif
-#include <stdio.h>
-
static MLKPackage *cl;
static MLKPackage *sys;
@@ -502,12 +504,7 @@ static MLKSymbol *MULTIPLE_VALUE_CALL;
//EnumProcessModules (...);
//GetProcAddress (..., [name UTF8String]);
#else
-#ifdef linux
function = dlsym (RTLD_DEFAULT, [name UTF8String]);
-#else
- // FIXME
- function = dlsym (NULL, [name UTF8String]);
-#endif
#endif
RETURN_VALUE (LAUTORELEASE ([[MLKForeignProcedure alloc]