summaryrefslogtreecommitdiffhomepage
path: root/dev/libSystem/src/VerifyCalls.cc
blob: 1c00612fee6b459b0ce2dd3a9e3acb193aa0e62a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* ========================================

  Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.

======================================== */

#include <libSystem/SystemKit/Err.h>
#include <libSystem/SystemKit/Syscall.h>
#include <libSystem/SystemKit/Verify.h>

using namespace LibSystem;

IMPORT_C Void _rtl_assert(Bool expr, const Char* origin) {
  if (!expr) {
    PrintOut(nullptr, "Assertion failed: %s\r", origin);
    libsys_syscall_arg_1(SYSCALL_HASH("_rtl_debug_break"));
  }
}