From 351d931ccf0b3eef058d8c02f36651d1b9539076 Mon Sep 17 00:00:00 2001 From: fangyunzhong Date: Thu, 30 Mar 2023 12:02:50 +0000 Subject: [PATCH] =?UTF-8?q?fixed=2095a0a89=20from=20https://gitee.com/fang?= =?UTF-8?q?-yunzhong/developtools=5Fglobal=5Fresource=5Ftool/pulls/90=20?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E8=A7=84=E8=8C=83=E5=91=8A=E8=AD=A6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangyunzhong --- src/file_entry.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/file_entry.cpp b/src/file_entry.cpp index e0d1cfb..e9d1a01 100644 --- a/src/file_entry.cpp +++ b/src/file_entry.cpp @@ -282,7 +282,7 @@ bool FileEntry::RemoveAllDirInner(const FileEntry &entry) { string path = entry.GetFilePath().GetPath(); if (entry.IsFile()) { -#if _WIN32 +#ifdef _WIN32 bool result = remove(AdapateLongPath(path).c_str()) == 0; #else bool result = remove(path.c_str()) == 0; @@ -299,7 +299,7 @@ bool FileEntry::RemoveAllDirInner(const FileEntry &entry) return false; } } -#if _WIN32 +#ifdef _WIN32 bool result = rmdir(AdapateLongPath(path).c_str()) == 0; #else bool result = rmdir(path.c_str()) == 0; @@ -315,7 +315,7 @@ bool FileEntry::CreateDirsInner(const string &path, string::size_type offset) { string::size_type pos = path.find_first_of(SEPARATE.front(), offset); if (pos == string::npos) { -#if _WIN32 +#ifdef _WIN32 return CreateDirectory(AdapateLongPath(path).c_str(), nullptr) != 0; #else return mkdir(path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0; @@ -324,7 +324,7 @@ bool FileEntry::CreateDirsInner(const string &path, string::size_type offset) string subPath = path.substr(0, pos + 1); if (!Exist(subPath)) { -#if _WIN32 +#ifdef _WIN32 if (!CreateDirectory(AdapateLongPath(subPath).c_str(), nullptr)) { #else if (mkdir(subPath.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) { @@ -360,7 +360,7 @@ void FileEntry::FilePath::Init() } } -#if _WIN32 +#ifdef _WIN32 string FileEntry::AdapateLongPath(const string &path) { if (path.size() >= MAX_PATH -12) { //the max file path can not exceed 260 - 12