mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
fix errors
This commit is contained in:
parent
dea3072cc8
commit
b48c7f9219
12
build.zig
12
build.zig
@ -245,9 +245,9 @@ pub fn buildForEmscripten(b: *std.Build, name: []const u8, root_source_file: []c
|
|||||||
\\ const writer = std.io.getStdErr().writer();
|
\\ const writer = std.io.getStdErr().writer();
|
||||||
\\ //TODO: It seems zig doesn't put error info into wasm binaries: https://github.com/ziglang/zig/issues/10426
|
\\ //TODO: It seems zig doesn't put error info into wasm binaries: https://github.com/ziglang/zig/issues/10426
|
||||||
\\ // So this always returns null.
|
\\ // So this always returns null.
|
||||||
\\ // if (@errorReturnTrace()) |trace| {
|
\\ // if (@errorReturnTrace()) |trace| {{
|
||||||
\\ // trace.format("{s}", .{}, writer);
|
\\ // trace.format("{{s}}", .{{}}, writer);
|
||||||
\\ // }
|
\\ // }}
|
||||||
\\ // I'm not really worried since web outputs are usually reserved for release anyway, which by then most errors should be fixed.
|
\\ // I'm not really worried since web outputs are usually reserved for release anyway, which by then most errors should be fixed.
|
||||||
\\ writer.print("THERE WAS AN ERROR:{{s}}\n", .{{@errorName(e)}}) catch {{}};
|
\\ writer.print("THERE WAS AN ERROR:{{s}}\n", .{{@errorName(e)}}) catch {{}};
|
||||||
\\ }};
|
\\ }};
|
||||||
@ -364,7 +364,11 @@ const webhack_c =
|
|||||||
\\int main(int argc, char** argv)
|
\\int main(int argc, char** argv)
|
||||||
\\{
|
\\{
|
||||||
\\ //TODO: possibly pass arguments into zig?
|
\\ //TODO: possibly pass arguments into zig?
|
||||||
\\ return web_emscripten_entry_point();
|
\\ int status = web_emscripten_entry_point();
|
||||||
|
\\ //emscripten won't print until a newline is formed, and often people forget the last "\n" of a print.
|
||||||
|
\\ // Missing lines can be really annoying, so to avoid that one last line is printed before the program exits.
|
||||||
|
\\ printf("\n");
|
||||||
|
\\ return status;
|
||||||
\\}
|
\\}
|
||||||
\\// Zig adds '__stack_chk_guard', '__stack_chk_fail', and 'errno',
|
\\// Zig adds '__stack_chk_guard', '__stack_chk_fail', and 'errno',
|
||||||
\\// which emscripten doesn't actually support.
|
\\// which emscripten doesn't actually support.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user