*: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized and may be missing. Closes #169
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
void
|
||||
RenameFile(Path oldpath, Path newpath)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (!MoveFileEx(oldpath.c_str(), newpath.c_str(),
|
||||
MOVEFILE_REPLACE_EXISTING))
|
||||
throw MakeLastError("Failed to rename file");
|
||||
@@ -42,7 +42,7 @@ RenameFile(Path oldpath, Path newpath)
|
||||
AllocatedPath
|
||||
ReadLink(Path path)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
(void)path;
|
||||
errno = EINVAL;
|
||||
return AllocatedPath::Null();
|
||||
@@ -63,7 +63,7 @@ ReadLink(Path path)
|
||||
void
|
||||
TruncateFile(Path path)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
HANDLE h = CreateFile(path.c_str(), GENERIC_WRITE, 0, nullptr,
|
||||
TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL,
|
||||
nullptr);
|
||||
@@ -83,7 +83,7 @@ TruncateFile(Path path)
|
||||
void
|
||||
RemoveFile(Path path)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (!DeleteFile(path.c_str()))
|
||||
throw FormatLastError("Failed to delete %s", path.c_str());
|
||||
#else
|
||||
|
Reference in New Issue
Block a user