Index: runtime/bin/extensions_macos.cc |
diff --git a/runtime/bin/extensions_macos.cc b/runtime/bin/extensions_macos.cc |
index d81e670eef10218fe7bc68228faa4d0d88a9083c..2d2788ee205597fa84b565cfd21af37224222a45 100644 |
--- a/runtime/bin/extensions_macos.cc |
+++ b/runtime/bin/extensions_macos.cc |
@@ -3,12 +3,17 @@ |
// BSD-style license that can be found in the LICENSE file. |
#include "bin/extensions.h" |
+#include <dlfcn.h> |
-#include "include/dart_api.h" |
-#include "platform/assert.h" |
+void* Extensions::LoadExtensionLibrary(const char* library_name) { |
+ char* library_path = MakeString("./%s.so", library_name); |
Mads Ager (google)
2012/03/07 14:31:48
lib%s.so?
Either that or remove the lib prefix on
Ivan Posva
2012/03/07 19:06:23
Please do not use .so extensions on Mac OS X. It i
Bill Hesse
2012/03/08 12:04:37
libfoo.so on linux and foo.dll on windows is the n
Bill Hesse
2012/03/08 12:04:37
This is not a .dylib. This is a bundle, not a sha
|
+ void* lib_handle = dlopen(library_path, RTLD_LAZY); |
+ delete[] library_path; |
+ return lib_handle; |
+} |
-Dart_Handle Extensions::LoadExtension(const char* extension_url, |
- Dart_Handle parent_library) { |
- UNIMPLEMENTED(); |
- return NULL; |
+void* Extensions::ResolveSymbol(void* lib_handle, const char* symbol) { |
+ void* result = dlsym(lib_handle, symbol); |
+ if (dlerror() != NULL) return NULL; |
+ return result; |
} |