From 1f950f4c2aeee13db9260f92cb807dfaf56eec25 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 31 Oct 2025 08:12:02 -0400 Subject: [PATCH] refactor: define SYSAPI_WINDOWS and WINAPI_WINDOWS in cmake, remove the define from Common.h --- CMakeLists.txt | 1 + src/lib/common/Common.h | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) 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