Skip to content

Add a cbool to ctypes.nim #24704

Open
Open
@maxpicklez

Description

@maxpicklez

Description

The ctypes.nim file does not include a definition for the bool type. Which was added in C99 and confusingly will be redefined in C23 to bool instead of uint8.

Nim Version

Nim Compiler Version 2.2.2 [Linux: amd64]
Compiled at 2025-02-06
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 6c34f62
active boot switches: -d:release

Current Output

@m..@s..@s..@[email protected]@[email protected]@snico@[email protected]:1137:17: error: conflicting types for 'emscripten_set_main_loop'
 1137 | N_NIMCALL(void, emscripten_set_main_loop)(tyProc__ln4kdL5W9bbX4a1xl8nnVXQ f, int fps, int simulate_infinite_loop);
      |                 ^
/home/gribble/src/emsdk/upstream/emscripten/cache/sysroot/include/emscripten/emscripten.h:41:6: note: previous declaration is here
   41 | void emscripten_set_main_loop(em_callback_func func, int fps, bool simulate_infinite_loop);
      |      ^

Expected Output

A working emscripten wasm page or at least continuation of the compilation process.

Known Workarounds

Revert this commit in the emsdk which reverts the type signature back to int.

Additional Information

C23 redefines bool so this may cause a different issue in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions