]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/OS/DLLManager.cxx
Windows compilation (1/3)
[cpPlugins.git] / lib / cpPlugins / OS / DLLManager.cxx
index 274c7dc208a76e697bfac59f591a5998477bae4e..ab3cf56d2e742f67b51a186b3eba612d3f932651 100644 (file)
@@ -1,25 +1,25 @@
 #include <cpPlugins/OS/DLLManager.h>
 
-#ifdef cpPlugins_SYS_WINDOWS
+#ifdef cpPlugins_OS_Windows
 #  include <Windows.h>
-#else // cpPlugins_SYS_WINDOWS
+#else // cpPlugins_OS_Windows
 #  include <dlfcn.h>
-#endif // cpPlugins_SYS_WINDOWS
+#endif // cpPlugins_OS_Windows
 
 // -------------------------------------------------------------------------
 void* cpPlugins::OS::DLLManager::
 Load( const std::string& fname, std::string& error )
 {
   void* hnd = NULL;
-#ifdef cpPlugins_SYS_WINDOWS
+#ifdef cpPlugins_OS_Windows
   hnd = ::LoadLibraryA( fname.c_str( ) );
-#else // cpPlugins_SYS_WINDOWS
+#else // cpPlugins_OS_Windows
   hnd = dlopen( fname.c_str( ), RTLD_LAZY | RTLD_GLOBAL );
   if( hnd == NULL )
     error = dlerror( );
   else
     dlerror( );
-#endif // cpPlugins_SYS_WINDOWS
+#endif // cpPlugins_OS_Windows
   return( hnd );
 }
 
@@ -27,11 +27,11 @@ Load( const std::string& fname, std::string& error )
 void cpPlugins::OS::DLLManager::
 UnLoad( void* hnd )
 {
-#ifdef cpPlugins_SYS_WINDOWS
+#ifdef cpPlugins_OS_Windows
   ::FreeLibrary( ( HMODULE )hnd );
-#else // cpPlugins_SYS_WINDOWS
+#else // cpPlugins_OS_Windows
   dlclose( hnd );
-#endif // cpPlugins_SYS_WINDOWS
+#endif // cpPlugins_OS_Windows
 }
 
 // -------------------------------------------------------------------------
@@ -41,11 +41,11 @@ GetFunctionHandle( void* hnd, const std::string& function )
   void* f = NULL;
   if( hnd != NULL )
   {
-#ifdef cpPlugins_SYS_WINDOWS
+#ifdef cpPlugins_OS_Windows
     f = ::GetProcAddress( ( HMODULE )hnd, function.c_str( ) );
-#else // cpPlugins_SYS_WINDOWS
+#else // cpPlugins_OS_Windows
     f = dlsym( hnd, function.c_str( ) );
-#endif // cpPlugins_SYS_WINDOWS
+#endif // cpPlugins_OS_Windows
   } // fi
   return( f );
 }