mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-26 07:25:00 -07:00
Add -foreign-error-procedures
This commit is contained in:
@@ -17,6 +17,24 @@ type_assertion_trap :: proc "contextless" () -> ! {
|
||||
}
|
||||
|
||||
|
||||
when ODIN_FOREIGN_ERROR_PROCEDURES {
|
||||
foreign {
|
||||
bounds_check_error :: proc "contextless" (file: string, line, column: i32, index, count: int) ---
|
||||
slice_handle_error :: proc "contextless" (file: string, line, column: i32, lo, hi: int, len: int) -> ! ---
|
||||
multi_pointer_slice_handle_error :: proc "contextless" (file: string, line, column: i32, lo, hi: int) -> ! ---
|
||||
multi_pointer_slice_expr_error :: proc "contextless" (file: string, line, column: i32, lo, hi: int) ---
|
||||
slice_expr_error_hi :: proc "contextless" (file: string, line, column: i32, hi: int, len: int) ---
|
||||
slice_expr_error_lo_hi :: proc "contextless" (file: string, line, column: i32, lo, hi: int, len: int) ---
|
||||
dynamic_array_expr_error :: proc "contextless" (file: string, line, column: i32, low, high, max: int) ---
|
||||
matrix_bounds_check_error :: proc "contextless" (file: string, line, column: i32, row_index, column_index, row_count, column_count: int) ---
|
||||
type_assertion_check :: proc "contextless" (ok: bool, file: string, line, column: i32, from, to: typeid) ---
|
||||
type_assertion_check2 :: proc "contextless" (ok: bool, file: string, line, column: i32, from, to: typeid, from_data: rawptr) ---
|
||||
make_slice_error_loc :: proc "contextless" (loc := #caller_location, len: int) ---
|
||||
make_dynamic_array_error_loc :: proc "contextless" (using loc := #caller_location, len, cap: int) ---
|
||||
make_map_expr_error_loc :: proc "contextless" (loc := #caller_location, cap: int) ---
|
||||
}
|
||||
} else {
|
||||
|
||||
bounds_check_error :: proc "contextless" (file: string, line, column: i32, index, count: int) {
|
||||
if 0 <= index && index < count {
|
||||
return
|
||||
@@ -231,7 +249,7 @@ make_map_expr_error_loc :: #force_inline proc "contextless" (loc := #caller_loca
|
||||
handle_error(loc, cap)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user