Hi, I just stumbled over a little problem when using the new webgpu.h bindings in emscripten (provided by the Dawn team, that's why I'm posting here):
There's a globally visible symbol defined in the webgpu.h header:
const uint64_t WGPU_WHOLE_SIZE = 0xffffffffffffffffULL; // UINT64_MAX
If the header is now included in different compilation units, this leads to a linker error because the linker sees the same symbols multiple times:
wasm-ld: error: duplicate symbol: WGPU_WHOLE_SIZE
>>> defined in wgpu/CMakeFiles/clear-wgpu.dir/clear-wgpu.c.obj
>>> defined in wgpu/libwgpu_entry.a(wgpu_entry.c.obj)
Putting a "static" in front fixes the problem, however:
(1) WGPU_WHOLE_SIZE doesn't seem to be used anywhere in the header, so I wonder if it is necessary at all
(2) IMHO a traditional "#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL)" would be better (since C doesn't have "proper" constants anyway)
Cheers!
-Floh.