duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

cubeb_assert.h (911B)


      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