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:
#pragma once
+#include "system.hpp"
+
#include "Checksum.hpp"
#include "Compressor.hpp"
#include "Util.hpp"
#pragma once
+#include "system.hpp"
+
#include "Error.hpp"
#include "Stat.hpp"
#pragma once
+#include "system.hpp"
+
#include "Compression.hpp"
#include <memory>
#pragma once
+#include "system.hpp"
+
#include "NonCopyable.hpp"
#include <cstdio>
#pragma once
+#include "system.hpp"
+
#include "third_party/fmt/core.h"
#include "third_party/nonstd/string_view.hpp"
#pragma once
+#include "system.hpp"
+
#include "Compressor.hpp"
#include "NonCopyable.hpp"
#pragma once
+#include "system.hpp"
+
#include "Decompressor.hpp"
#include "NonCopyable.hpp"
#include <cstdio>
#include <unistd.h>
-#ifdef _WIN32
-# include <windows.h>
-#else
+#ifndef _WIN32
# include <sys/ioctl.h>
#endif
#pragma once
+#include "system.hpp"
+
#include <string>
class ProgressBar
#pragma once
+#include "system.hpp"
+
#include "Util.hpp"
#include <string>
#pragma once
+#include "system.hpp"
+
#include "Config.hpp"
#include "Util.hpp"
# include <psapi.h>
# include <sys/locking.h>
# include <tchar.h>
-# include <windows.h>
#endif
// Destination for g_config.log_file.
#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)