Merge pull request #141 from slimsag/master

always provide default opaque{} external type implementations
This commit is contained in:
Robin Voetter
2024-06-02 23:25:51 +02:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -349,9 +349,9 @@ Note that this information is not everywhere as useful in the registry, leading
Defaults with the same ABI layout are generated for most platform-defined types. These can either by bitcasted to, or overridden by defining them in the project root:
```zig
pub const xcb_connection_t = if (@hasDecl(root, "xcb_connection_t")) root.xcb_connection_t else @Type(.Opaque);
pub const xcb_connection_t = if (@hasDecl(root, "xcb_connection_t")) root.xcb_connection_t else opaque{};
```
For some times (such as those from Google Games Platform) no default is known. Usage of these without providing a concrete type in the project root generates a compile error.
For some times (such as those from Google Games Platform) no default is known, but an `opaque{}` will be used by default. Usage of these without providing a concrete type in the project root is likely an error.
### Shader compilation

View File

@@ -1031,7 +1031,7 @@ fn Renderer(comptime WriterType: type) type {
try self.writer.writeAll(default);
try self.writer.writeAll(";\n");
} else {
try self.writer.print("@compileError(\"Missing type definition of '{s}'\");\n", .{name});
try self.writer.print("opaque {{}};\n", .{});
}
}