2023-08-28 20:46:50 -07:00
|
|
|
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
|
|
|
# pragma once
|
2023-09-25 13:42:29 -07:00
|
|
|
# include "debug.hpp"
|
|
|
|
# include "basic_types.hpp"
|
|
|
|
# include "src_start.cpp"
|
2023-08-28 20:46:50 -07:00
|
|
|
#endif
|
2023-08-21 17:30:13 -07:00
|
|
|
|
2023-08-03 20:18:33 -07:00
|
|
|
#pragma region Debug
|
2024-12-04 23:53:14 -08:00
|
|
|
GEN_API_C_BEGIN
|
2023-07-25 20:00:57 -07:00
|
|
|
|
2023-07-24 15:35:16 -07:00
|
|
|
void assert_handler( char const* condition, char const* file, s32 line, char const* msg, ... )
|
|
|
|
{
|
|
|
|
_printf_err( "%s:(%d): Assert Failure: ", file, line );
|
|
|
|
|
|
|
|
if ( condition )
|
2023-07-29 14:14:02 -07:00
|
|
|
_printf_err( "`%s` \n", condition );
|
2023-07-24 15:35:16 -07:00
|
|
|
|
|
|
|
if ( msg )
|
|
|
|
{
|
|
|
|
va_list va;
|
|
|
|
va_start( va, msg );
|
|
|
|
_printf_err_va( msg, va );
|
|
|
|
va_end( va );
|
|
|
|
}
|
|
|
|
|
|
|
|
_printf_err( "%s", "\n" );
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 assert_crash( char const* condition )
|
|
|
|
{
|
|
|
|
GEN_PANIC( condition );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined( GEN_SYSTEM_WINDOWS )
|
|
|
|
void process_exit( u32 code )
|
|
|
|
{
|
|
|
|
ExitProcess( code );
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# include <stdlib.h>
|
|
|
|
|
|
|
|
void process_exit( u32 code )
|
|
|
|
{
|
|
|
|
exit( code );
|
|
|
|
}
|
|
|
|
#endif
|
2023-07-25 20:00:57 -07:00
|
|
|
|
2024-12-04 23:53:14 -08:00
|
|
|
GEN_API_C_END
|
2023-07-25 20:00:57 -07:00
|
|
|
#pragma endregion Debug
|