OSX/iOS: Fix SDK incompatibility.
[luajit-2.0.git] / src / lj_assert.c
blob5c948b41e003817e0cf67a287be98b912594e521
1 /*
2 ** Internal assertions.
3 ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h
4 */
6 #define lj_assert_c
7 #define LUA_CORE
9 #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK)
11 #include <stdio.h>
13 #include "lj_obj.h"
15 void lj_assert_fail(global_State *g, const char *file, int line,
16 const char *func, const char *fmt, ...)
18 va_list argp;
19 va_start(argp, fmt);
20 fprintf(stderr, "LuaJIT ASSERT %s:%d: %s: ", file, line, func);
21 vfprintf(stderr, fmt, argp);
22 fputc('\n', stderr);
23 va_end(argp);
24 UNUSED(g); /* May be NULL. TODO: optionally dump state. */
25 abort();
28 #endif