VirtualBox

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

Last change on this file since 32375 was 15709, checked in by vboxsync, 16 years ago

crOpenGL: don't output debug messages in release build

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.3 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
27DECLEXPORT(void) crEnableWarnings(int onOff);
28
29DECLEXPORT(void) crDebug( char *format, ... ) PRINTF;
30DECLEXPORT(void) crWarning( char *format, ... ) PRINTF;
31DECLEXPORT(void) crInfo( char *format, ... ) PRINTF;
32
33DECLEXPORT(void) crError( char *format, ... ) NORETURN_PRINTF;
34
35/* Throw more info while opengl is not stable */
36#if defined(DEBUG) || 1
37#define CRASSERT( PRED ) ((PRED)?(void)0:crError( "Assertion failed: %s, file %s, line %d", #PRED, __FILE__, __LINE__))
38#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__))
39#else
40#define CRASSERT( PRED ) ((void)0)
41#define THREADASSERT( PRED ) ((void)0)
42#endif
43
44#ifdef __cplusplus
45}
46#endif
47
48#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