VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_error.h@ 50095

Last change on this file since 50095 was 50095, checked in by vboxsync, 11 years ago

crOpenGL: presentation infrastructure rework (still work in progress)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef CR_ERROR_H
8#define CR_ERROR_H
9
10#include <iprt/cdefs.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#ifndef __GNUC__
17#define NORETURN_PRINTF
18#define PRINTF
19#elif defined IN_GUEST
20#define NORETURN_PRINTF __attribute__ ((__noreturn__,format(printf,1,2)))
21#define PRINTF __attribute__ ((format(printf,1,2)))
22#else
23#define NORETURN_PRINTF
24#define PRINTF
25#endif
26
27#ifndef IN_RING0
28#define LOG(_m) do { crDebug _m ; } while (0)
29#define LOGREL(_m) do { crDebug _m ; } while (0)
30#define WARN(_m) do { crWarning _m ; AssertMsgFailed(_m); } while (0)
31#else
32#define LOG(_m) do { } while (0)
33#define LOGREL(_m) do { } while (0)
34#define WARN(_m) do { AssertMsgFailed(_m); } while (0)
35#endif
36
37DECLEXPORT(void) crEnableWarnings(int onOff);
38
39DECLEXPORT(void) crDebug(const char *format, ... ) PRINTF;
40#if defined(DEBUG_misha) && defined(RT_OS_WINDOWS)
41typedef void FNCRDEBUG(const char *format, ... ) PRINTF;
42typedef FNCRDEBUG *PFNCRDEBUG;
43DECLINLINE(PFNCRDEBUG) crGetDebug() {return crDebug;}
44# define crWarning (RT_BREAKPOINT(), crDebug)
45#else
46DECLEXPORT(void) crWarning(const char *format, ... ) PRINTF;
47#endif
48DECLEXPORT(void) crInfo(const char *format, ... ) PRINTF;
49
50DECLEXPORT(void) crError(const char *format, ... ) NORETURN_PRINTF;
51
52/* Throw more info while opengl is not stable */
53#if defined(DEBUG) || 1
54# ifdef DEBUG_misha
55# include <iprt/assert.h>
56# define CRASSERT Assert
57//extern int g_VBoxFbgFBreakDdi;
58# define CR_DDI_PROLOGUE() do { /*if (g_VBoxFbgFBreakDdi) {Assert(0);}*/ } while (0)
59# else
60# define CRASSERT( PRED ) ((PRED)?(void)0:crWarning( "Assertion failed: %s, file %s, line %d", #PRED, __FILE__, __LINE__))
61# define CR_DDI_PROLOGUE() do {} while (0)
62# endif
63# 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__))
64#else
65# define CRASSERT( PRED ) ((void)0)
66# define THREADASSERT( PRED ) ((void)0)
67# define CR_DDI_PROLOGUE() do {} while (0)
68#endif
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif /* CR_ERROR_H */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette