cr_error.h revision 03951d473e83c595e3b5a906ac1d248e18cd0860
/* Copyright (c) 2001, Stanford University
* All rights reserved.
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#ifndef CR_ERROR_H
#define CR_ERROR_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __GNUC__
#define NORETURN_PRINTF
#define PRINTF
#else
#define NORETURN_PRINTF
#define PRINTF
#endif
#ifndef WARN
# ifndef IN_RING0
# else
# endif
#endif
#if defined(DEBUG_misha) && defined(RT_OS_WINDOWS)
typedef FNCRDEBUG *PFNCRDEBUG;
#else
#endif
/* Throw more info while opengl is not stable */
#if defined(DEBUG) || 1
# ifdef DEBUG_misha
//extern int g_VBoxFbgFBreakDdi;
# define CR_DDI_PROLOGUE() do { /*if (g_VBoxFbgFBreakDdi) {Assert(0);}*/ } while (0)
# else
# define CRASSERT( PRED ) ((PRED)?(void)0:crWarning( "Assertion failed: %s, file %s, line %d", #PRED, __FILE__, __LINE__))
# define CR_DDI_PROLOGUE() do {} while (0)
# endif
# define THREADASSERT( PRED ) ((PRED)?(void)0:crError( "Are you trying to run a threaded app ?\nBuild with 'make threadsafe'\nAssertion failed: %s, file %s, line %d", #PRED, __FILE__, __LINE__))
#else
# define THREADASSERT( PRED ) ((void)0)
# define CR_DDI_PROLOGUE() do {} while (0)
#endif
#ifdef __cplusplus
}
#endif
#endif /* CR_ERROR_H */