| 1 | /* |
| 2 | * LegacyClonk |
| 3 | * |
| 4 | * Copyright (c) 2022, The LegacyClonk Team and contributors |
| 5 | * |
| 6 | * Distributed under the terms of the ISC license; see accompanying file |
| 7 | * "COPYING" for details. |
| 8 | * |
| 9 | * "Clonk" is a registered trademark of Matthes Bender, used with permission. |
| 10 | * See accompanying file "TRADEMARK" for details. |
| 11 | * |
| 12 | * To redistribute this file separately, substitute the full license texts |
| 13 | * for the above references. |
| 14 | */ |
| 15 | |
| 16 | #pragma once |
| 17 | |
| 18 | #if defined(NDEBUG) |
| 19 | |
| 20 | #define BREAKPOINT_HERE |
| 21 | |
| 22 | #elif defined(_WIN32) |
| 23 | |
| 24 | #include <intrin.h> |
| 25 | |
| 26 | #define BREAKPOINT_HERE __debugbreak() |
| 27 | |
| 28 | #elif __has_builtin(__builtin_debugtrap) |
| 29 | |
| 30 | #define BREAKPOINT_HERE __builtin_debugtrap() |
| 31 | |
| 32 | #else |
| 33 | |
| 34 | #include <csignal> |
| 35 | |
| 36 | #define BREAKPOINT_HERE std::raise(SIGTRAP) |
| 37 | |
| 38 | #endif |
| 39 | |