| 1 | //===----------------------------------------------------------------------===// |
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/common/assert.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "duckdb/common/winapi.hpp" |
| 10 | |
| 11 | #pragma once |
| 12 | |
| 13 | #if (defined(DUCKDB_USE_STANDARD_ASSERT) || !defined(DEBUG)) && !defined(DUCKDB_FORCE_ASSERT) |
| 14 | |
| 15 | #include <assert.h> |
| 16 | #define D_ASSERT assert |
| 17 | namespace duckdb { |
| 18 | DUCKDB_API void DuckDBAssertInternal(bool condition, const char *condition_name, const char *file, int linenr); |
| 19 | } |
| 20 | |
| 21 | #else |
| 22 | namespace duckdb { |
| 23 | DUCKDB_API void DuckDBAssertInternal(bool condition, const char *condition_name, const char *file, int linenr); |
| 24 | } |
| 25 | |
| 26 | #define D_ASSERT(condition) duckdb::DuckDBAssertInternal(bool(condition), #condition, __FILE__, __LINE__) |
| 27 | |
| 28 | #endif |
| 29 | |