Path: blob/master/libmupen64plus/mupen64plus-video-z64/src/rgl_assert.h
2 views
/*1* z642*3* Copyright (C) 2007 ziggy4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License along16* with this program; if not, write to the Free Software Foundation, Inc.,17* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.18*19**/2021#ifndef _RGL_ASSERT_H_22#define _RGL_ASSERT_H_2324#include <stdio.h>2526#ifdef RGL_ASSERT27inline void _rglAssert(int test, const char * s, int line, const char * file) {28if (!test) {29fprintf(stderr, "z64 assert failed (%s : %d) : %s\n", file, line, s);30fflush(stdout);31fflush(stderr);32*(unsigned int *)0 = 0xdeadbeef; // hopefully will generate a segfault33exit(-1);34}35}36#define rglAssert(test) _rglAssert((test), #test, __LINE__, __FILE__)37#else38#define rglAssert(test)39#endif4041#endif424344