]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Windows define and include restructuring (#492)
authorThomas Otto <thomas.otto@pdv-fs.de>
Sun, 24 Nov 2019 21:27:26 +0000 (22:27 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 24 Nov 2019 21:27:26 +0000 (22:27 +0100)
Set the _WIN32_WINNT macro only once in the generated config.h.

Include <windows.h> only once in system.hpp, unless these includes
are in third party libs - however third party includes themselves
should always be behind internal includes. Therefore also make
system.hpp the first include everywhere.

13 files changed:
src/CacheEntryWriter.hpp
src/CacheFile.hpp
src/Compressor.hpp
src/File.hpp
src/FormatNonstdStringView.hpp
src/NullCompressor.hpp
src/NullDecompressor.hpp
src/ProgressBar.cpp
src/ProgressBar.hpp
src/cleanup.hpp
src/compress.hpp
src/legacy_util.cpp
src/system.hpp

index 338aa173b052a10b4794ed9df91fe480e872498f..711035810c118cf6f810fea773db2f05af368af5 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "Checksum.hpp"
 #include "Compressor.hpp"
 #include "Util.hpp"
index 696458fe99cd1a006e6600344840d32fd0c9dd1f..0c98d337d4ab59b7e1bbde8d6db49452cad1988a 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "Error.hpp"
 #include "Stat.hpp"
 
index 2cc1fc0e52ae841496c904bd7ebc2ede7bdbc22b..3295874c5084323cc43f55e2283383ab1d4db243 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "Compression.hpp"
 
 #include <memory>
index e76be8f214c380372ac3ac3abcc61a344991c36a..0cac829c441e8226582cc6d1516c9e89a6cbc1c3 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "NonCopyable.hpp"
 
 #include <cstdio>
index c2f93ad9a126423952492b5879dd62c558c9b109..ded6de1d5fa04d9b7bc97c47f6de6baa3de77c06 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "third_party/fmt/core.h"
 #include "third_party/nonstd/string_view.hpp"
 
index 1dfdf55c5a19d0b8024e2655ea3064f8b18e9fcd..9a4fcd16db9e9912991459344236ddc14897d6d6 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "Compressor.hpp"
 #include "NonCopyable.hpp"
 
index cef5b4458dead48cac569da28bc8725d6680cf58..514ed7d7cf573389432ff00ae86f21baa563ccc9 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "Decompressor.hpp"
 #include "NonCopyable.hpp"
 
index 55db6a6bb9326e0c89dd6293de64581c279da4bf..a155fa9b0a5bebae425c70be4f44cea6c96f37cd 100644 (file)
@@ -23,9 +23,7 @@
 #include <cstdio>
 #include <unistd.h>
 
-#ifdef _WIN32
-#  include <windows.h>
-#else
+#ifndef _WIN32
 #  include <sys/ioctl.h>
 #endif
 
index c23696c590066495775e02bd3cf21e16aea27c37..8aefa897d4e6170d6419c8ca92dbdf16f918531d 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include <string>
 
 class ProgressBar
index ac81e8fc912f6396cf4b2bddb956d161c713de3d..4951fef32613204bdab8866c4ab6702290c9ea09 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "Util.hpp"
 
 #include <string>
index 96bbed0204ef9ba7ab1cef341bcfa8fae1f3c3f0..72423be1c5e79fffccb3a23844055cb47ac74a0c 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "Config.hpp"
 #include "Util.hpp"
 
index b818d5b418429c95f94e393fd938025c5b3bc0dc..b752355c6edc5f60ab271dc09d4753ca6484ada4 100644 (file)
@@ -60,7 +60,6 @@
 #  include <psapi.h>
 #  include <sys/locking.h>
 #  include <tchar.h>
-#  include <windows.h>
 #endif
 
 // Destination for g_config.log_file.
index 3fff3e186f36c6ec90ae3cbae2c8ac78e8e77242..4307a7e9c0da21facf3c4194fa261636a48baca2 100644 (file)
@@ -71,7 +71,8 @@ extern char** environ;
 
 #ifdef _WIN32
 #  ifndef _WIN32_WINNT
-#    define _WIN32_WINNT 0x0501
+// _WIN32_WINNT is set in the generated header config.h
+#    error _WIN32_WINNT is undefined
 #  endif
 #  include <windows.h>
 #  define mkdir(a, b) mkdir(a)