Fix preprocessor checks WIN32 => _WIN32
The latter is predefined by Windows toolchains and is more reliable. Reported-by: Michael Stürmer <michael.stuermer@schaeffler.com>
This commit is contained in:
parent
84672a8409
commit
83af11d411
|
@ -156,7 +156,7 @@ bool cmExecProgramCommand::RunCommand(const char* command,
|
||||||
verbose = false;
|
verbose = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
// if the command does not start with a quote, then
|
// if the command does not start with a quote, then
|
||||||
// try to find the program, and if the program can not be
|
// try to find the program, and if the program can not be
|
||||||
// found use system to run the command as it must be a built in
|
// found use system to run the command as it must be a built in
|
||||||
|
@ -219,7 +219,7 @@ bool cmExecProgramCommand::RunCommand(const char* command,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
if(dir)
|
if(dir)
|
||||||
{
|
{
|
||||||
cmsysProcess_SetWorkingDirectory(cp, dir);
|
cmsysProcess_SetWorkingDirectory(cp, dir);
|
||||||
|
@ -305,7 +305,7 @@ bool cmExecProgramCommand::RunCommand(const char* command,
|
||||||
}
|
}
|
||||||
if(!msg.empty())
|
if(!msg.empty())
|
||||||
{
|
{
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
// Old Windows process execution printed this info.
|
// Old Windows process execution printed this info.
|
||||||
msg += "\n\nfor command: ";
|
msg += "\n\nfor command: ";
|
||||||
msg += command;
|
msg += command;
|
||||||
|
|
|
@ -66,7 +66,7 @@ static mode_t mode_setuid = S_ISUID;
|
||||||
static mode_t mode_setgid = S_ISGID;
|
static mode_t mode_setgid = S_ISGID;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32) && defined(CMAKE_ENCODING_UTF8)
|
#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8)
|
||||||
// libcurl doesn't support file:// urls for unicode filenames on Windows.
|
// libcurl doesn't support file:// urls for unicode filenames on Windows.
|
||||||
// Convert string from UTF-8 to ACP if this is a file:// URL.
|
// Convert string from UTF-8 to ACP if this is a file:// URL.
|
||||||
static std::string fix_file_url_windows(const std::string& url)
|
static std::string fix_file_url_windows(const std::string& url)
|
||||||
|
@ -3156,7 +3156,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) && defined(CMAKE_ENCODING_UTF8)
|
#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8)
|
||||||
url = fix_file_url_windows(url);
|
url = fix_file_url_windows(url);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3411,7 +3411,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
|
||||||
|
|
||||||
unsigned long file_size = cmsys::SystemTools::FileLength(filename);
|
unsigned long file_size = cmsys::SystemTools::FileLength(filename);
|
||||||
|
|
||||||
#if defined(WIN32) && defined(CMAKE_ENCODING_UTF8)
|
#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8)
|
||||||
url = fix_file_url_windows(url);
|
url = fix_file_url_windows(url);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -609,7 +609,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target)
|
||||||
|
|
||||||
// Ensure we have write permission in case .in was read-only.
|
// Ensure we have write permission in case .in was read-only.
|
||||||
mode_t perm = 0;
|
mode_t perm = 0;
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
mode_t mode_write = S_IWRITE;
|
mode_t mode_write = S_IWRITE;
|
||||||
#else
|
#else
|
||||||
mode_t mode_write = S_IWUSR;
|
mode_t mode_write = S_IWUSR;
|
||||||
|
|
Loading…
Reference in New Issue