| ... | @@ -211,13 +211,24 @@ fn EfiMain(handle: uefi.Handle, system_table: *uefi.tables.SystemTable) callconv | ... | @@ -211,13 +211,24 @@ fn EfiMain(handle: uefi.Handle, system_table: *uefi.tables.SystemTable) callconv |
| 211 | root.main(); | 211 | root.main(); |
| 212 | return 0; | 212 | return 0; |
| 213 | }, | 213 | }, |
| 214 | usize => { | | |
| 215 | return root.main(); | | |
| 216 | }, | | |
| 217 | uefi.Status => { | 214 | uefi.Status => { |
| 218 | return @intFromEnum(root.main()); | 215 | return @intFromEnum(root.main()); |
| 219 | }, | 216 | }, |
| 220 | else => @compileError("expected return type of main to be 'void', 'noreturn', 'usize', or 'std.os.uefi.Status'"), | 217 | uefi.Error!void => { |
| | 218 | root.main() catch |err| switch (err) { |
| | 219 | error.Unexpected => @panic("EfiMain: unexpected error"), |
| | 220 | else => { |
| | 221 | const status = uefi.Status.fromError(@errorCast(err)); |
| | 222 | return @intFromEnum(status); |
| | 223 | }, |
| | 224 | }; |
| | 225 | |
| | 226 | return 0; |
| | 227 | }, |
| | 228 | else => @compileError( |
| | 229 | "expected return type of main to be 'void', 'noreturn', " ++ |
| | 230 | "'uefi.Status', or 'uefi.Error!void'", |
| | 231 | ), |
| 221 | } | 232 | } |
| 222 | } | 233 | } |
| 223 | | 234 | |