Skip to content

Replace vendored mini_*.h with upstream *.h #8760

@alexreinking

Description

@alexreinking

We use a decoupled approach for obtaining the SPIRV and Vulkan headers without requiring systemwide installation. However, we have ever-rotting (#8743) copies of other headers vendored (and sometimes patched!) in our runtime.

Because the runtime is freestanding, we cannot rely on standard headers. Even so, we should provide minimal internal implementations of the required standard headers (e.g. stdint.h, stddef.h) to allow the upstream copies of, for example, webgpu.h to be included unmodified.

In the case of webgpu, we need only a few definitions (see my draft #8714):

#define NULL nullptr

#define SIZE_MAX ((size_t)-1)
#define UINT32_MAX ((uint32_t)-1)
#define UINT64_MAX ((uint64_t)-1)

#define UINT8_C(v) (v)
#define UINT16_C(v) (v)
#define UINT32_C(v) (v##U)
#define UINT64_C(v) (v##ULL)

We have the following mini_*.h headers:

Note that I'm not saying we should take hard dependencies on these headers, only that we should have equally mechanical ways of downloading and extracting the unmodified upstream copies to our dependencies/ subtree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev_meetingTopic to be discussed at the next dev meeting

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions