Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/dep/cubeb/src/cubeb_assert.h
4246 views
1
/*
2
* Copyright © 2017 Mozilla Foundation
3
*
4
* This program is made available under an ISC-style license. See the
5
* accompanying file LICENSE for details.
6
*/
7
8
#ifndef CUBEB_ASSERT
9
#define CUBEB_ASSERT
10
11
#include <stdio.h>
12
#include <stdlib.h>
13
14
/**
15
* This allow using an external release assert method. This file should only
16
* export a function or macro called XASSERT that aborts the program.
17
*/
18
19
#define XASSERT(expr) \
20
do { \
21
if (!(expr)) { \
22
fprintf(stderr, "%s:%d - fatal error: %s\n", __FILE__, __LINE__, #expr); \
23
abort(); \
24
} \
25
} while (0)
26
27
#endif
28
29