Fix to load the file for p21read on WIN32/MINGW

This commit is contained in:
rbertucat
2011-09-15 16:19:38 -04:00
committed by Mark Pictor
parent 1b69382718
commit 02feb6f152
2 changed files with 13 additions and 4 deletions
+5
View File
@@ -34,3 +34,8 @@ add_definitions(
)
SCL_ADDLIB(steputils "${LIBSTEPUTILS_SRCS}" "")
IF(MINGW)
TARGET_LINK_LIBRARIES(steputils shlwapi.lib)
ENDIF(MINGW)
+8 -4
View File
@@ -54,6 +54,10 @@
#include <string>
#include <iostream>
#if defined(__WIN32__)
#include <shlwapi.h>
#endif
///////////////////////////////////////////////////////////////////////////////
//
// Create a new DirObj object.
@@ -159,7 +163,7 @@ bool DirObj::Reset( const std::string & path ) {
///////////////////////////////////////////////////////////////////////////////
bool DirObj::IsADirectory( const char * path ) {
#if defined(__WIN32__) && !defined(__mingw32__)
#if defined(__WIN32__)
return PathIsDirectory( path );
#else
struct stat st;
@@ -189,11 +193,11 @@ bool DirObj::IsADirectory( const char * path ) {
///////////////////////////////////////////////////////////////////////////////
const std::string DirObj::Normalize( const std::string & path ) {
char * b = 0;
char b[MAX_PATH];
std::string buf;
const char * slash;
#if defined(__WIN32__) && !defined(__mingw32__)
_fullpath(b,path.c_str(),MAXPATHLEN);
#if defined(__WIN32__)
PathCanonicalize(b, path.c_str());
slash = "\\";
#else
b = realpath(path.c_str(),0);