ROSE 0.11.145.192
ROSE_ABORT.h
1#ifndef ROSE_ABORT_H
2#define ROSE_ABORT_H
3
5// ROSE_ABORT
6//
7// Purpose: Terminates the process with failure exit status.
8//
9// This macro is intended to be used when you want to forcibly terminate the process in a way that's easy for debugging,
10// regardless of whether ROSE is configured for debugging or production.
11//
12// When ROSE is configured for debugging, it will print the file and line information before terminating with a possible core
13// dump. When ROSE is configured for production, it will terminate with a possible core dump.
14//
15// These semantics were reached by consensus at ROSE meeting 2021-03-23. If you make behavioral changes here, please discuss
16// them first.
18
19#ifndef ROSE_ABORT
20 #ifdef NDEBUG
21 #include <stdlib.h>
22 #define ROSE_ABORT() abort()
23 #else
24 #include <assert.h>
25 #define ROSE_ABORT() assert(false)
26 #endif
27#endif
28
29#endif