From 938f527c79c655e810363cf8301f84958b15212a Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 3 Oct 2011 01:57:52 +0000 Subject: [PATCH] RTLD_SELF is osx-specific --- gc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gc.c b/gc.c index 432ca38d..184b79db 100644 --- a/gc.c +++ b/gc.c @@ -8,6 +8,12 @@ #include #endif +#ifdef __APPLE__ +#define SEXP_RTLD_DEFAULT RTLD_SELF +#else +#define SEXP_RTLD_DEFAULT RTLD_DEFAULT +#endif + #define SEXP_BANNER(x) ("**************** GC "x"\n") #define SEXP_MINIMUM_OBJECT_SIZE (sexp_heap_align(1)) @@ -546,7 +552,7 @@ void sexp_offset_heap_pointers (sexp_heap heap, sexp_heap from_heap, sexp* types sexp_dl_handle(sexp_opcode_dl(p)) = dlopen(sexp_string_data(sexp_dl_file(sexp_opcode_dl(p))), RTLD_LAZY); sexp_opcode_func(p) = dlsym(sexp_dl_handle(sexp_opcode_dl(p)), sexp_string_data(name)); } else { - sexp_opcode_func(p) = dlsym(RTLD_SELF, sexp_string_data(name)); + sexp_opcode_func(p) = dlsym(SEXP_RTLD_DEFAULT, sexp_string_data(name)); } } t = types[sexp_pointer_tag(p)];