summaryrefslogtreecommitdiff
path: root/src/system/Error.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-12 10:22:20 +0100
committerMax Kellermann <max@musicpd.org>2017-12-12 10:22:20 +0100
commitdfaf08743cade4c10c464bfbbb15d8f96c6e5cd9 (patch)
tree09be190640403b134b8967e1daf0d72445b146ed /src/system/Error.hxx
parentd9552d8a6d2fbc916e5a7bf6e75c2d3b4f29c38e (diff)
*: 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
Diffstat (limited to 'src/system/Error.hxx')
-rw-r--r--src/system/Error.hxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/system/Error.hxx b/src/system/Error.hxx
index 4d89e12c8..8420100e2 100644
--- a/src/system/Error.hxx
+++ b/src/system/Error.hxx
@@ -47,7 +47,7 @@ FormatSystemError(std::error_code code, const char *fmt, Args&&... args)
return std::system_error(code, buffer);
}
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
@@ -90,7 +90,7 @@ FormatLastError(const char *fmt, Args&&... args)
std::forward<Args>(args)...);
}
-#endif /* WIN32 */
+#endif /* _WIN32 */
#include <errno.h>
#include <string.h>
@@ -106,7 +106,7 @@ FormatLastError(const char *fmt, Args&&... args)
static inline const std::error_category &
ErrnoCategory()
{
-#ifdef WIN32
+#ifdef _WIN32
/* on Windows, the generic_category() is used for errno
values */
return std::generic_category();
@@ -151,7 +151,7 @@ gcc_pure
static inline bool
IsFileNotFound(const std::system_error &e) noexcept
{
-#ifdef WIN32
+#ifdef _WIN32
return e.code().category() == std::system_category() &&
e.code().value() == ERROR_FILE_NOT_FOUND;
#else
@@ -164,7 +164,7 @@ gcc_pure
static inline bool
IsPathNotFound(const std::system_error &e) noexcept
{
-#ifdef WIN32
+#ifdef _WIN32
return e.code().category() == std::system_category() &&
e.code().value() == ERROR_PATH_NOT_FOUND;
#else
@@ -177,7 +177,7 @@ gcc_pure
static inline bool
IsAccessDenied(const std::system_error &e) noexcept
{
-#ifdef WIN32
+#ifdef _WIN32
return e.code().category() == std::system_category() &&
e.code().value() == ERROR_ACCESS_DENIED;
#else