From bb8888944fe64a4b2d75560171172064cf08439d Mon Sep 17 00:00:00 2001 From: Matthias <19734415+MatthiasPortzel@users.noreply.github.com> Date: Sat, 29 Jun 2024 03:40:29 -0400 Subject: [PATCH] Use app provided panic handler if it exists (#209) --- core/src/start.zig | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core/src/start.zig b/core/src/start.zig index 91f637a..a2981b9 100644 --- a/core/src/start.zig +++ b/core/src/start.zig @@ -3,12 +3,7 @@ const microzig = @import("microzig"); const app = @import("app"); // Use microzig panic handler if not defined by an application -pub usingnamespace if (!@hasDecl(app, "panic")) - struct { - pub const panic = microzig.panic; - } -else - struct {}; +pub const panic = if (!@hasDecl(app, "panic")) microzig.panic else app.panic; pub const VectorTableOptions = if (@hasDecl(microzig.chip, "VectorTable")) blk: {