From 4081dd89e5ab4706d6fb0f35daa7762a91b74708 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 5 Jun 2026 18:17:38 +0900 Subject: [PATCH] Define `NO_SHLWAPI_STRFCNS` to not define `StrCat` This is a mechanical cleanup to avoid defining StrCat in shlwapi.h, which often requires us to undef StrCat before using absl::StrCat. There must be no functional change in the final executables. --- src/BUILD.bazel | 1 + src/base/file/recursive.cc | 2 -- src/base/win32/win_util.cc | 5 ----- src/renderer/win32/win32_image_util_test.cc | 2 -- src/renderer/win32/win32_renderer_util_test.cc | 2 -- src/win32/custom_action/custom_action.cc | 2 -- 6 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/BUILD.bazel b/src/BUILD.bazel index 12d8571d07..64c936c3c9 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -222,6 +222,7 @@ cc_library( "_ATL_NO_HOSTING", "ID_TRACE_LEVEL=1", "_MIDL_USE_GUIDDEF_", + "NO_SHLWAPI_STRFCNS", "PSAPI_VERSION=2", "UNICODE", "_UNICODE", diff --git a/src/base/file/recursive.cc b/src/base/file/recursive.cc index 83b704985d..c128a25e15 100644 --- a/src/base/file/recursive.cc +++ b/src/base/file/recursive.cc @@ -63,8 +63,6 @@ #include #endif // __ANDROID__ || TARGET_OS_IPHONE -#undef StrCat - namespace mozc::file { #ifdef _WIN32 diff --git a/src/base/win32/win_util.cc b/src/base/win32/win_util.cc index ef240fced5..d12a851107 100644 --- a/src/base/win32/win_util.cc +++ b/src/base/win32/win_util.cc @@ -54,11 +54,6 @@ #include "base/vlog.h" #include "base/win32/wide_char.h" -// Disable StrCat macro to use absl::StrCat. -#ifdef StrCat -#undef StrCat -#endif // StrCat - namespace mozc { namespace { diff --git a/src/renderer/win32/win32_image_util_test.cc b/src/renderer/win32/win32_image_util_test.cc index 81aac63727..89621cb06a 100644 --- a/src/renderer/win32/win32_image_util_test.cc +++ b/src/renderer/win32/win32_image_util_test.cc @@ -35,8 +35,6 @@ #include -#undef StrCat - #include #include #include diff --git a/src/renderer/win32/win32_renderer_util_test.cc b/src/renderer/win32/win32_renderer_util_test.cc index 14dadbd3ff..5e36af358a 100644 --- a/src/renderer/win32/win32_renderer_util_test.cc +++ b/src/renderer/win32/win32_renderer_util_test.cc @@ -33,8 +33,6 @@ #include #include -#undef StrCat // b/328804050 - #include #include #include diff --git a/src/win32/custom_action/custom_action.cc b/src/win32/custom_action/custom_action.cc index 8144b17639..7dc47c2f61 100644 --- a/src/win32/custom_action/custom_action.cc +++ b/src/win32/custom_action/custom_action.cc @@ -36,8 +36,6 @@ #include // clang-format on -#undef StrCat // NOLINT: TODO: triggers clang-tidy, defined by windows.h. - #include #include #include