From 01fc02beeee2a4c5ba66e6f93d9fb0d1fd6a4548 Mon Sep 17 00:00:00 2001 From: b-r-o-c-k Date: Sun, 4 Mar 2018 17:44:23 -0600 Subject: build/msvc: Add missing WIN32 macro MSVC predefines `_WIN32`, but not `WIN32`. Also, some unnecessary includes have been removed. --- CMakeLists.txt | 4 ++++ src/nvim/main.c | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4ff4d5ac3..8147afb14f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,7 @@ int main(void) if(MSVC) # XXX: /W4 gives too many warnings. #3241 add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) + add_definitions(-DWIN32) else() add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99) @@ -223,6 +224,9 @@ endif() if(MINGW) # Use POSIX compatible stdio in Mingw add_definitions(-D__USE_MINGW_ANSI_STDIO) +endif() +if(WIN32) + # Windows Vista is the minimum supported version add_definitions(-D_WIN32_WINNT=0x0600) endif() diff --git a/src/nvim/main.c b/src/nvim/main.c index 25fb0f14d8..4288d7f9d7 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -7,11 +7,6 @@ #include #include -#ifdef WIN32 -# include -# include -#endif - #include #include "nvim/ascii.h" -- cgit