Skip to content

CandidateWindow: parenthesize std::max so it builds with windows.h - #14

Open
DaveTseng2019 wants to merge 1 commit into
EasyIME:masterfrom
DaveTseng2019:fix/std-max-macro
Open

DaveTseng2019 wants to merge 1 commit into
EasyIME:masterfrom
DaveTseng2019:fix/std-max-macro

Conversation

@DaveTseng2019

Copy link
Copy Markdown
Contributor

a0eeea4 (#13) added std::max(1, candPerRow_) in CandidateWindow::itemRect(). windows.h defines a max() macro and NOMINMAX is not set, so the macro expands and MSVC fails with:

src\CandidateWindow.cpp(446,33): error C2589: '(': illegal token on right side of '::'

Writing (std::max)(...) keeps the macro from expanding. One line, no behavior change.

PIME master still pins libIME2 at 78e6104, so PIME CI has not built this commit yet; the next submodule bump would fail the same way.

Tested: built PIME (x86/x64, Visual Studio 2026) with this libIME2, ran ctest (4/4 passed), and installed it locally; typing with Chewing works.

Fully generated by Claude Code (Claude Opus 5.5) without human intervention.

🤖 Generated with Claude Code

a0eeea4 added std::max(1, candPerRow_) in itemRect(). windows.h defines
a max() macro and NOMINMAX is not set, so the macro expands and MSVC
stops with C2589 ("'(': illegal token on right side of '::'").
Writing (std::max)(...) keeps the macro from expanding.

PIME master still pins libIME2 at 78e6104, so PIME CI does not build
this commit yet; the next submodule bump would fail the same way.
Verified by building PIME (x86/x64, VS 2026) with this libIME2 and
running ctest (4/4 passed).

Fully generated by Claude Code (Claude Opus 5.5) without human intervention.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant