The Wayback Machine - https://web.archive.org/web/20260505051820/https://github.com/microsoft/terminal/pull/20035
Skip to content

conpty: remove accidental bool; use BOOL instead#20035

Merged
DHowett merged 3 commits intomainfrom
dev/duhowett/conpty-bOoL
Mar 31, 2026
Merged

conpty: remove accidental bool; use BOOL instead#20035
DHowett merged 3 commits intomainfrom
dev/duhowett/conpty-bOoL

Conversation

@DHowett
Copy link
Copy Markdown
Member

@DHowett DHowett commented Mar 30, 2026

Closes #20030

@DHowett DHowett changed the title conpty: remove accidental ool; use BOOL instead conpty: remove accidental bool; use BOOL instead Mar 30, 2026
if (_initialVisibility)
{
THROW_IF_FAILED(ConptyShowHidePseudoConsole(_hPC.get(), _initialVisibility));
THROW_IF_FAILED(ConptyShowHidePseudoConsole(_hPC.get(), _initialVisibility ? TRUE : FALSE));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lhecker years of doing win32 and i am still unclear whether stdbool/bool can implicitly convert to BOOL ;P

Copy link
Copy Markdown
Member

@lhecker lhecker Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's well defined. BOOL is an alias for int32, so bool <> BOOL works implicitly. The compiler inserts != 0 checks as needed. But the ABI is different! AArch64 does not require callers to zero upper bits in register arguments and bool is just 1 byte.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you care about the ARM64 ABI break. C has _Bool, which should match C++'s bool. As well, you could include <stdbool.h>, it defines a macro bool, so that bool is _Bool when using C. _Bool is part of the C standard, so it is safe to use.

There should also be an ABI break on x86, because of the use of WINAPI and the change from 1 byte bool to the 4 bytes BOOL. I did some testing and it looks like the exported function name should stays the same on x86, so there is no ABI break there.

@DHowett DHowett force-pushed the dev/duhowett/conpty-bOoL branch from 46f5ce4 to b715412 Compare March 30, 2026 22:29
@Link1J
Copy link
Copy Markdown

Link1J commented Mar 31, 2026

I think you want to close #20030.

@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Mar 31, 2026

huh, i'm not sure where I got the ID I did. thanks.

I'm not particularly concerned about the ABI; since it's deployed side by side (or in some cases, statically linked) per application, authors are not updating the source version without also updating the binary version. :)

@DHowett DHowett merged commit 01f8a40 into main Mar 31, 2026
20 checks passed
@DHowett DHowett deleted the dev/duhowett/conpty-bOoL branch March 31, 2026 16:58
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.24 Servicing Pipeline Mar 31, 2026
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.25 Servicing Pipeline Mar 31, 2026
DHowett added a commit that referenced this pull request Mar 31, 2026
Closes #19102

(cherry picked from commit 01f8a40)
Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zgoyJIE
Service-Version: 1.25
DHowett added a commit that referenced this pull request Mar 31, 2026
Closes #19102

(cherry picked from commit 01f8a40)
Service-Card-Id: PVTI_lADOAF3p4s4BBcTlzgoyJIM
Service-Version: 1.24
@DHowett DHowett moved this from Cherry Picked to Validated in 1.24 Servicing Pipeline Apr 30, 2026
@DHowett DHowett moved this from Validated to Shipped in 1.24 Servicing Pipeline Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Cherry Picked

Development

Successfully merging this pull request may close these issues.

Build error in conpty.h due to undefined bool identifier

3 participants