Cthulhu  0.2.10
Cthulhu compiler collection
init.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-only
2 
3 #include "os/core.h"
4 #include "os_common.h"
5 
6 #include <stdlib.h>
7 #include <crtdbg.h>
8 
9 #include "core/win32.h" // IWYU pragma: keep
10 
11 CT_LOCAL size_t impl_maxname(void)
12 {
13  return MAX_PATH;
14 }
15 
16 CT_LOCAL size_t impl_maxpath(void)
17 {
18  return MAX_PATH;
19 }
20 
21 CT_LOCAL void impl_init(void)
22 {
23  _CrtSetReportMode(_CRT_ASSERT, 0);
24  _set_abort_behavior(0, _WRITE_ABORT_MSG);
25 }
26 
28 {
29  TerminateProcess(GetCurrentProcess(), code);
30 }
31 
33 {
34  ExitThread(status);
36 }
37 
38 CT_LOCAL void impl_abort(void)
39 {
40  abort();
41 }
int os_exitcode_t
program exit code
Definition: core.h:67
#define CT_UNREACHABLE()
mark a point in code as unreachable
Definition: compiler.h:102
#define CT_LOCAL
Definition: compiler.h:166
unsigned os_status_t
thread return code
Definition: core.h:71
CT_LOCAL size_t impl_maxpath(void)
Definition: init.c:18
CT_LOCAL void impl_thread_exit(os_status_t status)
Definition: init.c:54
CT_LOCAL size_t impl_maxname(void)
Definition: init.c:13
CT_LOCAL void impl_init(void)
Definition: init.c:23
CT_LOCAL void impl_abort(void)
Definition: init.c:59
CT_LOCAL void impl_exit(os_exitcode_t code)
Definition: init.c:49