From dec895e8d3a0838272e694d392416e59c058938c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 10 Dec 2020 10:10:36 +1000 Subject: [PATCH] cmake: move two windows #defines to the main cmake file We have a check for windows here anyway, let's move the defines here and we can drop it in the common header file. And since on Unix HAVE_CONFIG_H is always defined, we can drop the else condition too. --- CMakeLists.txt | 2 ++ src/lib/common/common.h | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c56b30be..b90e790b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,6 +292,8 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") list (APPEND libs Wtsapi32 Userenv Wininet comsuppw Shlwapi) add_definitions ( + /DSYSAPI_WIN32=1 + /DWINAPI_MSWINDOWS=1 /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS diff --git a/src/lib/common/common.h b/src/lib/common/common.h index 5eac5684..2feea235 100644 --- a/src/lib/common/common.h +++ b/src/lib/common/common.h @@ -18,13 +18,8 @@ #pragma once -#if defined(_WIN32) -# define SYSAPI_WIN32 1 -# define WINAPI_MSWINDOWS 1 -#elif HAVE_CONFIG_H +#if HAVE_CONFIG_H # include "config.h" -#else -# error "config.h missing" #endif // VC++ has built-in sized types