diff --git a/CMakeLists.txt b/CMakeLists.txt index 499a6d53b..554b98eda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,7 @@ set(REQUIRED_LIBPORTAL_VERSION 0.8) set(REQUIRED_QT_VERSION 6.7.0) if (WIN32) + add_definitions(-DSYSAPI_WIN32 -DWINAPI_MSWINDOWS) # VSCMD_ARG_TGT_ARCH is set on CI if ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "") # NOT on CI diff --git a/src/lib/common/Common.h b/src/lib/common/Common.h index 8487895c2..cfdb6fcad 100644 --- a/src/lib/common/Common.h +++ b/src/lib/common/Common.h @@ -7,14 +7,13 @@ #pragma once -#if defined(_WIN32) -#define SYSAPI_WIN32 1 -#define WINAPI_MSWINDOWS 1 -#elif HAVE_CONFIG_H +#if !SYSAPI_WIN32 +#if HAVE_CONFIG_H #include "Config.h" #else #error "config.h missing" #endif +#endif // define nullptr #include