refactor: don't avoid sys/types.h on when building for Windows

We've already used it unguarded in `httpserver.cpp` for years, with no
build issues.
This commit is contained in:
fanquake 2023-01-24 12:18:08 +00:00
parent 369d4c03b7
commit 54e4061189
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
4 changed files with 13 additions and 12 deletions

View file

@ -62,15 +62,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

View file

@ -24,11 +24,12 @@
#include <thread>
#include <vector>
#include <sys/types.h> // must go before a number of other headers
#ifdef WIN32
#include <windows.h>
#include <winreg.h>
#else
#include <sys/types.h> // must go before a number of other headers
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/resource.h>

View file

@ -35,9 +35,11 @@
#include <univalue.h>
#include <utility>
#include <vector>
#include <sys/types.h>
#ifndef WIN32
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#endif

View file

@ -15,8 +15,15 @@
#include <stdint.h>
#ifndef WIN32
#include <sys/stat.h>
// 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 wallet {