From 4f7b932fee79e8f446c435f59a67af0d8031c3af Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Wed, 14 Jan 2026 05:02:50 +0800 Subject: [PATCH] build: correctly set MSVC `__cplusplus` (#8120) * build: correctly set MSVC `__cplusplus` * refactor: let utf8cpp infer `UTF_CPP_CPLUSPLUS` --- CMakeLists.txt | 2 ++ libtransmission/utils.cc | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1143d71b1..165e464db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,6 +223,8 @@ if(WIN32) set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} /utf-8") # Reduce noise (at least for now) set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} /wd4244 /wd4267") + # Correctly set __cplusplus macro value + set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} /Zc:__cplusplus") # Make caching-friendly (store debug info inside object files) foreach(T IN ITEMS ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) string(TOUPPER "${T}" T) diff --git a/libtransmission/utils.cc b/libtransmission/utils.cc index 81c2f356c..c85a2fd04 100644 --- a/libtransmission/utils.cc +++ b/libtransmission/utils.cc @@ -36,7 +36,6 @@ #include /* umask() */ #endif -#define UTF_CPP_CPLUSPLUS 201703L #include #include