X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FConfig.h.in;h=6cec4adba2ace6e7f9b2cf827765c14888e1baac;hb=e6bef8234ffd9030c68a6786466a08cf144b7871;hp=75ae331c78387b5ea180f761fe0e68e78ca6fb00;hpb=1b0022070ff3b5f80f6f8c8b87f73032f5685eaf;p=cpPlugins.git diff --git a/lib/cpPlugins/Config.h.in b/lib/cpPlugins/Config.h.in index 75ae331..6cec4ad 100644 --- a/lib/cpPlugins/Config.h.in +++ b/lib/cpPlugins/Config.h.in @@ -2,6 +2,7 @@ #define __CPPLUGINS__CONFIG__H__ #include +#include #include /* @@ -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 +# include #elif defined( linux ) || defined( __linux ) # define cpPlugins_SYS_LINUX # define cpPlugins_PLUGIN_PREFIX "lib" @@ -77,6 +77,7 @@ * Some functions * ========================================================================= */ +#include 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 ); } };