Skip to content

Comments

Use bool return type for various low-level emscripten APIs#26316

Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:use_bool_return
Open

Use bool return type for various low-level emscripten APIs#26316
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:use_bool_return

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Feb 20, 2026

We converted a EM_BOOL from int to bool without too much fallout so
I think should a backwards compatible change for all users.

It is of course conceivable to construct code that would notice this change (e.g. sizeof(emscripten_is_main_runtime_thread()) but its seems extremely unlikely.

I think using the explicit bool type helps make these function more
clear, and avoids confusion with tradition "0 means success" C
functions.

@sbc100 sbc100 changed the title Use bool return type for various low emscripten APIs Use bool return type for various low-level emscripten APIs Feb 20, 2026
@sbc100 sbc100 requested review from kripken and tlively February 20, 2026 23:56
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

Please also add a changelog entry. lgtm with that + comments

We converted a EM_BOOL from `int` to `bool` without too much fallout so
I think should a backwards compatible change for all users.

It is of course conceivable to construct code that would notice this
change (e.g. `sizeof(emscripten_is_main_runtime_thread())` but its seems
extremely unlikely.

I think using the explicit bool type helps make these function more
clear, and avoids confusion with tradition "0 means success" C
functions.
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.

2 participants