5252
5353#include < string>
5454#include < iostream>
55+ #include < cstring>
5556
56- #if defined(__WIN32__)
57+ #ifdef _WIN32
5758#include < shlwapi.h>
5859#endif
5960
@@ -145,7 +146,7 @@ int DirObj::Index( const char * name ) {
145146bool DirObj::Reset ( const std::string & path ) {
146147 bool successful = IsADirectory ( path.c_str () );
147148 if ( successful ) {
148- #ifdef __WIN32__
149+ #ifdef _WIN32
149150 WIN32_FIND_DATA FindFileData;
150151 HANDLE hFind;
151152
@@ -182,7 +183,7 @@ bool DirObj::Reset( const std::string & path ) {
182183// /////////////////////////////////////////////////////////////////////////////
183184
184185bool DirObj::IsADirectory ( const char * path ) {
185- #if defined(__WIN32__)
186+ #ifdef _WIN32
186187 if ( PathIsDirectory ( path ) ) {
187188 return true ;
188189 }
@@ -217,7 +218,7 @@ bool DirObj::IsADirectory( const char * path ) {
217218std::string DirObj::Normalize ( const std::string & path ) {
218219 std::string buf;
219220 const char * slash;
220- #if defined(__WIN32__)
221+ #ifdef _WIN32
221222 char b[MAX_PATH];
222223 PathCanonicalize ( b, path.c_str () );
223224 slash = " \\ " ;
@@ -231,7 +232,7 @@ std::string DirObj::Normalize( const std::string & path ) {
231232 } else {
232233 buf.assign ( b );
233234
234- #if !defined(__WIN32__ )
235+ #if !defined(_WIN32 )
235236 free (b);
236237#endif
237238 }
@@ -254,7 +255,7 @@ std::string DirObj::Normalize( const std::string & path ) {
254255// /////////////////////////////////////////////////////////////////////////////
255256
256257const char * DirObj::ValidDirectories ( const char * path ) {
257- #ifdef __WIN32__
258+ #ifdef _WIN32
258259 static char buf[MAX_PATH + 1 ];
259260#else
260261 static char buf[MAXPATHLEN + 1 ];
@@ -308,7 +309,7 @@ void DirObj::InsertFile( const char * f, int index ) {
308309 CheckIndex ( index );
309310 spot = &fileList[index];
310311 }
311- #ifdef __MSVC__
312+ #ifdef _MSC_VER
312313 char * string = _strdup ( f );
313314#else
314315 char * string = strdup ( f );
0 commit comments