EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
EBGeometry_Macros.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Robert Marskar <robert.marskar@sintef.no>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
11#ifndef EBGEOMETRY_MACROS_HPP
12#define EBGEOMETRY_MACROS_HPP
13
14#include <cstdio>
15#include <cstdlib>
16
48#if defined(EBGEOMETRY_ENABLE_ASSERTIONS)
49#define EBGEOMETRY_EXPECT(cond) \
50 do { \
51 if (!(cond)) { \
52 std::fprintf(stderr, \
53 "EBGeometry assertion failed: (%s)\n file: %s\n line: %d\n function: %s\n", \
54 #cond, \
55 __FILE__, \
56 __LINE__, \
57 static_cast<const char*>(__func__)); \
58 std::abort(); \
59 } \
60 } while (0)
61#else
62#define EBGEOMETRY_EXPECT(cond) ((void)(cond))
63#endif
64
65#endif // EBGEOMETRY_MACROS_HPP