diff --git a/src/compat/compat.h b/src/compat/compat.h index eeac0805db..5dd73eb717 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -63,15 +63,6 @@ typedef unsigned int SOCKET; #endif #endif -// Windows doesn't define S_IRUSR or S_IWUSR. We define both -// here, with the same values as glibc (see stat.h). -#ifdef WIN32 -#ifndef S_IRUSR -#define S_IRUSR 0400 -#define S_IWUSR 0200 -#endif -#endif - // Windows defines MAX_PATH as it's maximum path length. // We define MAX_PATH for use on non-Windows systems. #ifndef WIN32 diff --git a/src/randomenv.cpp b/src/randomenv.cpp index 01e8f62e9c..4cfe94acac 100644 --- a/src/randomenv.cpp +++ b/src/randomenv.cpp @@ -25,11 +25,12 @@ #include #include +#include // must go before a number of other headers + #ifdef WIN32 #include #include #else -#include // must go before a number of other headers #include #include #include diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 1a53f5cb16..fbdb851ae1 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -37,9 +37,11 @@ #include #include #include + +#include + #ifndef WIN32 #include -#include #include #endif diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp index 4d642192ce..ef6947a25f 100644 --- a/src/wallet/bdb.cpp +++ b/src/wallet/bdb.cpp @@ -13,8 +13,15 @@ #include -#ifndef WIN32 #include + +// Windows may not define S_IRUSR or S_IWUSR. We define both +// here, with the same values as glibc (see stat.h). +#ifdef WIN32 +#ifndef S_IRUSR +#define S_IRUSR 0400 +#define S_IWUSR 0200 +#endif #endif namespace {