Przeglądaj źródła

ERR: Fixed use of _findfirst for MSVC 6.

Brad King 22 lat temu
rodzic
commit
41c8677a95
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      Source/kwsys/Directory.cxx

+ 6 - 1
Source/kwsys/Directory.cxx

@@ -81,6 +81,11 @@ namespace KWSYS_NAMESPACE
 
 
 bool Directory::Load(const char* name)
 bool Directory::Load(const char* name)
 {
 {
+#if _MSC_VER < 1300
+  long srchHandle;
+#else
+  intptr_t srchHandle;
+#endif
   char* buf;
   char* buf;
   size_t n = strlen(name);
   size_t n = strlen(name);
   if ( name[n - 1] == '/' ) 
   if ( name[n - 1] == '/' ) 
@@ -96,7 +101,7 @@ bool Directory::Load(const char* name)
   struct _finddata_t data;      // data of current file
   struct _finddata_t data;      // data of current file
   
   
   // Now put them into the file array
   // Now put them into the file array
-  intptr_t srchHandle = _findfirst(buf, &data);
+  srchHandle = _findfirst(buf, &data);
   delete [] buf;
   delete [] buf;
   
   
   if ( srchHandle == -1 )
   if ( srchHandle == -1 )