base: use int for ssize_t on 32-bit Windows - #7136
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Use int for Perfetto's Windows ssize_t definition. This preserves the width and value range on all Windows architectures and makes the definition compatible with common embedders. Electron has carried this downstream fix for Win32 builds since 2022.
|
Do you have any link to the Electron's code you are mentioning? From https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types I see followed by So MSDN headers suggests it should be a long |
|
https://github.com/electron/electron/blob/main/patches/perfetto/define_ssize_t_to_be_intptr_t_to_match_libuv.patch |
|
Hmm I see.
So the same headers deliberately use long for the Win32 API type and int for the POSIX-ish lowercase one. libuv's intptr_t matches the CRT exactly on both so mingw seems to be on your side
Also worth knowing: This already landed once: #4800 (Feb 2026) changed it to int, then #4830 reverted the whole PR as it broke google3 internal build. I would probably do this instead |
|
libuv also define SSIZE_MAX in guard block so your example code would cause some problem |
|
@primiano What is the correct way to push this PR forward ? |
Use int for Perfetto's Windows ssize_t definition. This preserves the width and value range on all Windows architectures and makes the definition compatible with common embedders.
Electron has carried this downstream fix for Win32 builds since 2022.