diff options
author | Florin T <florint@gmail.com> | 2022-06-07 02:06:12 -0700 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2022-08-20 13:30:28 +0200 |
commit | 5739866ec2ac5137732141e9984e5498f387a39c (patch) | |
tree | ac6d6cd771693469a3188a0882798398cb09635b | |
parent | c532b79d60c8f22e4a66d8f93b927f79e88b94dd (diff) | |
download | ccache-5739866ec2ac5137732141e9984e5498f387a39c.tar.gz |
fix: Fix build for MSVC (#1078)
For Windows the order of the includes is important in wincompat.hpp.
(cherry picked from commit 375d566635a934ba22287c391f39e58e85aa8567)
-rw-r--r-- | src/core/wincompat.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/wincompat.hpp b/src/core/wincompat.hpp index e550593c..20827109 100644 --- a/src/core/wincompat.hpp +++ b/src/core/wincompat.hpp @@ -75,9 +75,13 @@ const mode_t S_IWUSR = mode_t(_S_IWRITE); # define NOMINMAX 1 # define WIN32_NO_STATUS // clang-format off +# include <winsock2.h> // struct timeval +// windows must be included after winsock2 +// https://stackoverflow.com/questions/1372480/c-redefinition-header-files-winsock2-h # include <windows.h> +// bccrypt must go after windows.h +// https://stackoverflow.com/questions/57472787/compile-errors-when-using-c-and-bcrypt-header # include <bcrypt.h> // NTSTATUS -# include <winsock2.h> // struct timeval // clang-format on # undef WIN32_NO_STATUS # include <ntstatus.h> |