[clfft] 11/64: fix LoadSharedLibrary for mac
Jérôme Kieffer
kieffer-guest at moszumanska.debian.org
Wed May 20 07:33:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
kieffer-guest pushed a commit to branch develop
in repository clfft.
commit 48fb4852a7da555b553eba0c80c7bf0766529aa1
Author: Gaëtan Lehmann <gaetan.lehmann at gmail.com>
Date: Mon Feb 23 10:46:55 2015 +0100
fix LoadSharedLibrary for mac
---
src/include/sharedLibrary.h | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/include/sharedLibrary.h b/src/include/sharedLibrary.h
index e5e65de..85a4210 100644
--- a/src/include/sharedLibrary.h
+++ b/src/include/sharedLibrary.h
@@ -29,21 +29,31 @@
#include <dlfcn.h>
#endif
-inline void* LoadSharedLibrary( std::string linuxPrefix, std::string libraryName, bool quiet )
+inline void* LoadSharedLibrary( std::string unixPrefix, std::string libraryName, bool quiet )
{
#if defined( _WIN32 )
libraryName += ".dll";
// HMODULE is actually the load address; function returns NULL if it cannot find the shared library
HMODULE fileHandle = ::LoadLibraryExA( libraryName.c_str( ), NULL, NULL );
-#else
- tstring linuxName = linuxPrefix;
+#elif defined(__linux__)
+ tstring linuxName = unixPrefix;
linuxName += libraryName += ".so";
void* fileHandle = ::dlopen( linuxName.c_str( ), RTLD_NOW );
if( !quiet && !fileHandle )
{
std::cerr << ::dlerror( ) << std::endl;
}
+#elif defined(__APPLE__)
+ tstring appleName = unixPrefix;
+ appleName += libraryName += ".dylib";
+ void* fileHandle = ::dlopen( appleName.c_str( ), RTLD_NOW );
+ if( !quiet && !fileHandle )
+ {
+ std::cerr << ::dlerror( ) << std::endl;
+ }
+#else
+ #error "unsupported platform""
#endif
return fileHandle;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clfft.git
More information about the debian-science-commits
mailing list