Skip to content

Commit

Permalink
Merge pull request OSGeo#11556 from rouault/mingw64_workaround
Browse files Browse the repository at this point in the history
cpl_vsil_win32.cpp: no longer test for __MSVCRT_VERSION__ >= 0x0601 assuming this is always available given how antiquated this is
  • Loading branch information
rouault authored Dec 29, 2024
2 parents a6fed4d + 575a196 commit c363307
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions port/cpl_vsil_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,6 @@ int VSIWin32FilesystemHandler::Stat(const char *pszFilename,
VSIStatBufL *pStatBuf, int nFlags)

{
#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x0601
if (CPLTestBool(CPLGetConfigOption("GDAL_FILENAME_IS_UTF8", "YES")))
{
wchar_t *pwszFilename =
Expand Down Expand Up @@ -936,7 +935,6 @@ int VSIWin32FilesystemHandler::Stat(const char *pszFilename,
return nResult;
}
else
#endif
{
(void)nFlags;
return (VSI_STAT64(pszFilename, pStatBuf));
Expand All @@ -951,7 +949,6 @@ int VSIWin32FilesystemHandler::Stat(const char *pszFilename,
int VSIWin32FilesystemHandler::Unlink(const char *pszFilename)

{
#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x0601
if (CPLTestBool(CPLGetConfigOption("GDAL_FILENAME_IS_UTF8", "YES")))
{
wchar_t *pwszFilename =
Expand All @@ -962,7 +959,6 @@ int VSIWin32FilesystemHandler::Unlink(const char *pszFilename)
return nResult;
}
else
#endif
{
return unlink(pszFilename);
}
Expand All @@ -975,7 +971,6 @@ int VSIWin32FilesystemHandler::Unlink(const char *pszFilename)
int VSIWin32FilesystemHandler::Rename(const char *oldpath, const char *newpath)

{
#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x0601
if (CPLTestBool(CPLGetConfigOption("GDAL_FILENAME_IS_UTF8", "YES")))
{
wchar_t *pwszOldPath =
Expand All @@ -989,7 +984,6 @@ int VSIWin32FilesystemHandler::Rename(const char *oldpath, const char *newpath)
return nResult;
}
else
#endif
{
return rename(oldpath, newpath);
}
Expand All @@ -999,11 +993,9 @@ int VSIWin32FilesystemHandler::Rename(const char *oldpath, const char *newpath)
/* Mkdir() */
/************************************************************************/

int VSIWin32FilesystemHandler::Mkdir(const char *pszPathname, long nMode)
int VSIWin32FilesystemHandler::Mkdir(const char *pszPathname, long /* nMode */)

{
(void)nMode;
#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x0601
if (CPLTestBool(CPLGetConfigOption("GDAL_FILENAME_IS_UTF8", "YES")))
{
wchar_t *pwszFilename =
Expand All @@ -1014,7 +1006,6 @@ int VSIWin32FilesystemHandler::Mkdir(const char *pszPathname, long nMode)
return nResult;
}
else
#endif
{
return mkdir(pszPathname);
}
Expand All @@ -1027,7 +1018,6 @@ int VSIWin32FilesystemHandler::Mkdir(const char *pszPathname, long nMode)
int VSIWin32FilesystemHandler::Rmdir(const char *pszPathname)

{
#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x0601
if (CPLTestBool(CPLGetConfigOption("GDAL_FILENAME_IS_UTF8", "YES")))
{
wchar_t *pwszFilename =
Expand All @@ -1038,7 +1028,6 @@ int VSIWin32FilesystemHandler::Rmdir(const char *pszPathname)
return nResult;
}
else
#endif
{
return rmdir(pszPathname);
}
Expand All @@ -1051,7 +1040,6 @@ int VSIWin32FilesystemHandler::Rmdir(const char *pszPathname)
char **VSIWin32FilesystemHandler::ReadDirEx(const char *pszPath, int nMaxFiles)

{
#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x0601
if (CPLTestBool(CPLGetConfigOption("GDAL_FILENAME_IS_UTF8", "YES")))
{
struct _wfinddata_t c_file;
Expand Down Expand Up @@ -1091,7 +1079,6 @@ char **VSIWin32FilesystemHandler::ReadDirEx(const char *pszPath, int nMaxFiles)
return oDir.StealList();
}
else
#endif
{
struct _finddata_t c_file;
intptr_t hFile;
Expand Down Expand Up @@ -1192,7 +1179,6 @@ bool VSIWin32FilesystemHandler::IsLocal(const char *pszPath)
std::string VSIWin32FilesystemHandler::GetCanonicalFilename(
const std::string &osFilename) const
{
#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x0601
if (CPLTestBool(CPLGetConfigOption("GDAL_FILENAME_IS_UTF8", "YES")))
{
wchar_t *pwszFilename =
Expand All @@ -1208,7 +1194,6 @@ std::string VSIWin32FilesystemHandler::GetCanonicalFilename(
return osRet;
}
else
#endif
{
char longPath[MAX_PATH];
DWORD result = GetLongPathNameA(osFilename.c_str(), longPath, MAX_PATH);
Expand Down

0 comments on commit c363307

Please sign in to comment.