diff --git a/CMakeLists.txt b/CMakeLists.txt index 71a87695..6297b2ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,7 +189,7 @@ elseif (INTEL) endif() if (WIN32) - add_definitions(-DNTDDI_VERSION=0x06020000 -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNOMINMAX -DUNICODE -D_UNICODE) + add_definitions(-DNTDDI_VERSION=0x06020000 -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNOMINMAX -DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN) endif() if (CYGWIN) add_definitions(-D_DEFAULT_SOURCE=1 -DFD_SETSIZE=4096) diff --git a/tdutils/td/utils/port/FileFd.cpp b/tdutils/td/utils/port/FileFd.cpp index f49184fd..8b9529eb 100644 --- a/tdutils/td/utils/port/FileFd.cpp +++ b/tdutils/td/utils/port/FileFd.cpp @@ -11,6 +11,7 @@ #include "td/utils/port/wstring_convert.h" #endif +#include "td/utils/common.h" #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/port/detail/PollableFd.h" @@ -32,6 +33,10 @@ #include #endif +#if TD_PORT_WINDOWS && defined(WIN32_LEAN_AND_MEAN) +#include +#endif + namespace td { namespace {