From a688a6f61a8decadf90efa04ca5ddd91fe701375 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 19 Sep 2007 18:37:25 -0600 Subject: [PATCH] use lib%s.dylib to map library names on Darwin --- src/system.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/system.cpp b/src/system.cpp index 12404c1646..5ede163711 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -597,9 +597,15 @@ class MySystem: public System { void* p; unsigned nameLength = (name ? strlen(name) : 0); if (mapName) { +#ifdef __APPLE__ + unsigned size = nameLength + 10; + char buffer[size]; + snprintf(buffer, size, "lib%s.dylib", name); +#else unsigned size = nameLength + 7; char buffer[size]; snprintf(buffer, size, "lib%s.so", name); +#endif p = dlopen(buffer, RTLD_LAZY); } else { p = dlopen(name, RTLD_LAZY);