aboutsummaryrefslogtreecommitdiff
path: root/include/assert.h
blob: 72d0e8e27b48ceedb54865cec2d921da4a1409d3e5087a1029f866638c741119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

/*
 * C89 assert.h file.
 *
 * Copyright © 2022-2026 Samuel Lidén Borell <samuel@kodafritt.se>
 *
 * SPDX-License-Identifier: EUPL-1.2+ OR LGPL-2.1-or-later
 */

/* assert.h can be included multiple times! */
#undef assert
#ifdef NDEBUG
#    define assert(e)
#else
#    define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
#endif

#ifndef _DS9K_ASSERT_H
#define _DS9K_ASSERT_H
void _assert(const char *expr, const char *filename, unsigned line);
#endif