diff --git a/src/unlocker/cache-cleaner.cpp b/src/unlocker/cache-cleaner.cpp index 94d5f25..f04cc1c 100644 --- a/src/unlocker/cache-cleaner.cpp +++ b/src/unlocker/cache-cleaner.cpp @@ -1,9 +1,9 @@ #include "cache-cleaner.h" +#include "win-platform.h" #include #include -#include #include #include diff --git a/src/unlocker/main.cpp b/src/unlocker/main.cpp index 8d34bce..66db04f 100644 --- a/src/unlocker/main.cpp +++ b/src/unlocker/main.cpp @@ -9,20 +9,18 @@ #include "proxy-configurator.h" #include "cache-cleaner.h" -#if defined(__MINGW32__) || defined(__MINGW64__) - #include -#else - #include - - // from: WinBase.h - #define CREATE_NO_WINDOW 0x08000000 -#endif +#include "win-platform.h" #include #include #include #include +#ifndef CREATE_NO_WINDOW + // from: WinBase.h + #define CREATE_NO_WINDOW 0x08000000 +#endif + bool running = true; TinyMITMProxy* proxy = nullptr; ProxyConfigurator* conf = nullptr; diff --git a/src/unlocker/proxy-configurator.cpp b/src/unlocker/proxy-configurator.cpp index 449a2e5..35da142 100644 --- a/src/unlocker/proxy-configurator.cpp +++ b/src/unlocker/proxy-configurator.cpp @@ -2,8 +2,8 @@ #include "log-sink.h" -typedef void* HWND; -#include +#include "win-platform.h" + #include #include #include diff --git a/src/unlocker/utils.cpp b/src/unlocker/utils.cpp index f19ea77..c0229c8 100644 --- a/src/unlocker/utils.cpp +++ b/src/unlocker/utils.cpp @@ -1,6 +1,7 @@ #include "utils.h" -#include +#include "win-platform.h" + #include std::string utils::getExePath() diff --git a/src/unlocker/win-platform.h b/src/unlocker/win-platform.h new file mode 100644 index 0000000..beaa07e --- /dev/null +++ b/src/unlocker/win-platform.h @@ -0,0 +1,12 @@ +#pragma once + +#ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN +#endif +#ifndef NOMINMAX + #define NOMINMAX +#endif + +#if defined(_WIN32) + #include +#endif