Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
Unreachable.h
Go to the documentation of this file.
1 //===-- serialbox/core/Unreachable.h ------------------------------------------------*- C++ -*-===//
2 //
3 // S E R I A L B O X
4 //
5 // This file is distributed under terms of BSD license.
6 // See LICENSE.txt for more information
7 //
8 //===------------------------------------------------------------------------------------------===//
9 //
13 //===------------------------------------------------------------------------------------------===//
14 
15 #ifndef SERIALBOX_CORE_UNREACHABLE_H
16 #define SERIALBOX_CORE_UNREACHABLE_H
17 
19 
20 namespace serialbox {
21 
24 
30 SERIALBOX_ATTRIBUTE_NORETURN void serialbox_unreachable_internal(const char* msg = nullptr,
31  const char* file = nullptr,
32  unsigned line = 0);
33 
40 #ifndef NDEBUG
41 #define serialbox_unreachable(msg) \
42  ::serialbox::serialbox_unreachable_internal(msg, __FILE__, __LINE__)
43 #elif defined(SERIALBOX_BUILTIN_UNREACHABLE)
44 #define serialbox_unreachable(msg) SERIALBOX_BUILTIN_UNREACHABLE
45 #else
46 #define serialbox_unreachable(msg) ::serialbox::serialbox_unreachable_internal()
47 #endif
48 
50 
51 } // namespace serialbox
52 
53 #endif
Namespace of the serialbox library.
Definition: Archive.h:25
#define SERIALBOX_ATTRIBUTE_NORETURN
Mark a method as "no return".
Definition: Compiler.h:102