소스 검색

fix UNICODE compile error

ithewei 4 년 전
부모
커밋
314e6ca37a
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 3
      cpputil/hdir.cpp
  2. 1 1
      cpputil/hpath.cpp

+ 3 - 3
cpputil/hdir.cpp

@@ -61,8 +61,8 @@ int listdir(const char* dir, std::list<hdir_t>& dirs) {
 #elif defined(OS_WIN)
     // FindFirstFile -> FindNextFile -> FindClose
     strcat(path, "*");
-    WIN32_FIND_DATA data;
-    HANDLE h = FindFirstFile(path, &data);
+    WIN32_FIND_DATAA data;
+    HANDLE h = FindFirstFileA(path, &data);
     if (h == NULL) {
         return -1;
     }
@@ -80,7 +80,7 @@ int listdir(const char* dir, std::list<hdir_t>& dirs) {
         tmp.mtime = FileTime2Epoch(data.ftLastWriteTime);
         tmp.ctime = FileTime2Epoch(data.ftCreationTime);
         dirs.push_back(tmp);
-    } while (FindNextFile(h, &data));
+    } while (FindNextFileA(h, &data));
     FindClose(h);
 #endif
     dirs.sort(less);

+ 1 - 1
cpputil/hpath.cpp

@@ -24,7 +24,7 @@ bool HPath::isfile(const char* path) {
 
 bool HPath::islink(const char* path) {
 #ifdef OS_WIN
-    return HPath::isdir(path) && (GetFileAttributes(path) & FILE_ATTRIBUTE_REPARSE_POINT);
+    return HPath::isdir(path) && (GetFileAttributesA(path) & FILE_ATTRIBUTE_REPARSE_POINT);
 #else
     if (access(path, 0) != 0) return false;
     struct stat st;