VirtualBox

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

Last change on this file since 69474 was 69474, checked in by vboxsync, 7 years ago

*: scm updates - header files should have 'svn:keywords=Id Revision' too (doesn't mean they have to use them).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
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 WARN
17# ifndef IN_RING0
18# define LOG(_m) do { crDebug _m ; } while (0)
19# define LOGREL(_m) do { crDebug _m ; } while (0)
20# define WARN(_m) do { crWarning _m ; AssertMsgFailed(_m); } while (0)
21# else
22# define LOG(_m) do { } while (0)
23# define LOGREL(_m) do { } while (0)
24# define WARN(_m) do { AssertMsgFailed(_m); } while (0)
25# endif
26#endif
27
28DECLEXPORT(void) crEnableWarnings(int onOff);
29
30DECLEXPORT(void) crDebug(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
31DECLEXPORT(void) crDbgCmdPrint(const char *description1, const char *description2, const char *cmd, ...);
32DECLEXPORT(void) crDbgCmdSymLoadPrint(const char *modName, const void*pvAddress);
33#if defined(DEBUG_misha) && defined(RT_OS_WINDOWS)
34typedef void FNCRDEBUG(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
35typedef FNCRDEBUG *PFNCRDEBUG;
36DECLINLINE(PFNCRDEBUG) crGetDebug() {return crDebug;}
37# define crWarning (RT_BREAKPOINT(), crDebug)
38#else
39DECLEXPORT(void) crWarning(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
40#endif
41DECLEXPORT(void) crInfo(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
42
43DECLEXPORT(void) crError(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
44
45/* Throw more info while opengl is not stable */
46#if defined(DEBUG) || 1
47# ifdef DEBUG_misha
48# include <iprt/assert.h>
49# define CRASSERT Assert
50/*extern int g_VBoxFbgFBreakDdi;*/
51# define CR_DDI_PROLOGUE() do { /*if (g_VBoxFbgFBreakDdi) {Assert(0);}*/ } while (0)
52# else
53# define CRASSERT( PRED ) ((PRED)?(void)0:crWarning( "Assertion failed: %s=%d, file %s, line %d", #PRED, (int)(intptr_t)(PRED), __FILE__, __LINE__))
54# define CR_DDI_PROLOGUE() do {} while (0)
55# endif
56# 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__))
57#else
58# define CRASSERT( PRED ) ((void)0)
59# define THREADASSERT( PRED ) ((void)0)
60# define CR_DDI_PROLOGUE() do {} while (0)
61#endif
62
63#ifdef __cplusplus
64}
65#endif
66
67#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