]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Config.h.in
MPR objects updated
[cpPlugins.git] / lib / cpPlugins / Config.h.in
index 75ae331c78387b5ea180f761fe0e68e78ca6fb00..6cec4adba2ace6e7f9b2cf827765c14888e1baac 100644 (file)
@@ -2,6 +2,7 @@
 #define __CPPLUGINS__CONFIG__H__
 
 #include <cpPlugins/cpPlugins_Export.h>
+#include <cpPlugins_Config.h>
 #include <string>
 
 /*
@@ -21,7 +22,6 @@
  * =========================================================================
  */
 
-#define ITK_MANUAL_INSTANTIATION
 #define cpPlugins_CONFIG_FILE "plugins.cfg"
 
 #define cpPlugins_QT4_USED @QT4_FOUND@
@@ -43,9 +43,9 @@
 #  ifndef WIN32_LEAN_AND_MEAN
 #    define WIN32_LEAN_AND_MEAN
 #  endif
-#  ifndef NOMINMAX
-#    define NOMINMAX
-#  endif
+#  define NOMINMAX
+#  include <windows.h>
+#  include <tchar.h>
 #elif defined( linux ) || defined( __linux )
 #  define cpPlugins_SYS_LINUX
 #  define cpPlugins_PLUGIN_PREFIX "lib"
@@ -77,6 +77,7 @@
  * Some functions
  * =========================================================================
  */
+#include <iostream>
 namespace cpPlugins
 {
   struct PathHelper
@@ -94,14 +95,22 @@ namespace cpPlugins
     // ---------------------------------------------------------------------
     inline static std::string CanonicalPath( const std::string& path )
       {
+        std::string ret = "";
 #ifdef cpPlugins_SYS_WINDOWS
         TCHAR  buffer[ 4096 ] = TEXT( "" );
         TCHAR** lppPart = { NULL };
         GetFullPathName( path.c_str( ), 4096, buffer, lppPart );
-        return( std::string( buffer ) );
+        ret = std::string( buffer );
 #else // cpPlugins_SYS_WINDOWS
-        return( std::string( realpath( path.c_str( ), NULL ) ) );
+        char* canonical_path = realpath( path.c_str( ), NULL );
+        if( canonical_path != NULL )
+        {
+          ret = canonical_path;
+          free( canonical_path );
+
+        } // fi
 #endif // cpPlugins_SYS_WINDOWS
+        return( ret );
       }
   };