VirtualBox

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

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

build fix

  • 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 WARN
28# ifndef IN_RING0
29# define LOG(_m) do { crDebug _m ; } while (0)
30# define LOGREL(_m) do { crDebug _m ; } while (0)
31# define WARN(_m) do { crWarning _m ; AssertMsgFailed(_m); } while (0)
32# else
33# define LOG(_m) do { } while (0)
34# define LOGREL(_m) do { } while (0)
35# define WARN(_m) do { AssertMsgFailed(_m); } while (0)
36# endif
37#endif
38
39DECLEXPORT(void) crEnableWarnings(int onOff);
40
41DECLEXPORT(void) crDebug(const char *format, ... ) PRINTF;
42#if defined(DEBUG_misha) && defined(RT_OS_WINDOWS)
43typedef void FNCRDEBUG(const char *format, ... ) PRINTF;
44typedef FNCRDEBUG *PFNCRDEBUG;
45DECLINLINE(PFNCRDEBUG) crGetDebug() {return crDebug;}
46# define crWarning (RT_BREAKPOINT(), crDebug)
47#else
48DECLEXPORT(void) crWarning(const char *format, ... ) PRINTF;
49#endif
50DECLEXPORT(void) crInfo(const char *format, ... ) PRINTF;
51
52DECLEXPORT(void) crError(const char *format, ... ) NORETURN_PRINTF;
53
54/* Throw more info while opengl is not stable */
55#if defined(DEBUG) || 1
56# ifdef DEBUG_misha
57# include <iprt/assert.h>
58# define CRASSERT Assert
59//extern int g_VBoxFbgFBreakDdi;
60# define CR_DDI_PROLOGUE() do { /*if (g_VBoxFbgFBreakDdi) {Assert(0);}*/ } while (0)
61# else
62# define CRASSERT( PRED ) ((PRED)?(void)0:crWarning( "Assertion failed: %s, file %s, line %d", #PRED, __FILE__, __LINE__))
63# define CR_DDI_PROLOGUE() do {} while (0)
64# endif
65# 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__))
66#else
67# define CRASSERT( PRED ) ((void)0)
68# define THREADASSERT( PRED ) ((void)0)
69# define CR_DDI_PROLOGUE() do {} while (0)
70#endif
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif /* CR_ERROR_H */
Note: See TracBrowser for help on using the repository browser.

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