Skip to content

Conversation

@JkarVN
Copy link

@JkarVN JkarVN commented Dec 20, 2025

…ws SDK header conflicts in pcg-cpp

The build was failing on Windows (MSVC) with error C2678 due to ambiguous 'operator|' calls.

Root cause: Windows SDK headers (winuser.h, winnt.h, etc.) define multiple operator| overloads for various enums. When using a literal integer '1' with pcg_extras types, the compiler cannot distinguish between PCG's custom operators and Windows' enum operators.

Solution: Explicitly cast the literal to 'itype' to resolve the ambiguity. This ensures the compiler selects the correct operator defined in pcg-cpp while maintaining full cross-platform compatibility for Linux and macOS.

…ws SDK header conflicts in pcg-cpp

The build was failing on Windows (MSVC) with error C2678 due to 
ambiguous 'operator|' calls. 

Root cause: Windows SDK headers (winuser.h, winnt.h, etc.) define 
multiple operator| overloads for various enums. When using a literal 
integer '1' with pcg_extras types, the compiler cannot distinguish 
between PCG's custom operators and Windows' enum operators.

Solution: Explicitly cast the literal to 'itype' to resolve the 
ambiguity. This ensures the compiler selects the correct operator 
defined in pcg-cpp while maintaining full cross-platform compatibility 
for Linux and macOS.
@JkarVN
Copy link
Author

JkarVN commented Dec 24, 2025

Merged into Total-Random/pcg-cpp

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