summaryrefslogtreecommitdiffstats
path: root/src/VBox/GuestHost/OpenGL/include/cr_error.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:46 +0000
commitf8fe689a81f906d1b91bb3220acde2a4ecb14c5b (patch)
tree26484e9d7e2c67806c2d1760196ff01aaa858e8c /src/VBox/GuestHost/OpenGL/include/cr_error.h
parentInitial commit. (diff)
downloadvirtualbox-f8fe689a81f906d1b91bb3220acde2a4ecb14c5b.tar.xz
virtualbox-f8fe689a81f906d1b91bb3220acde2a4ecb14c5b.zip
Adding upstream version 6.0.4-dfsg.upstream/6.0.4-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/include/cr_error.h')
-rw-r--r--src/VBox/GuestHost/OpenGL/include/cr_error.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/include/cr_error.h b/src/VBox/GuestHost/OpenGL/include/cr_error.h
new file mode 100644
index 00000000..81572dc0
--- /dev/null
+++ b/src/VBox/GuestHost/OpenGL/include/cr_error.h
@@ -0,0 +1,67 @@
+/* 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
+
+#include <iprt/cdefs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef WARN
+# ifndef IN_RING0
+# define LOG(_m) do { crDebug _m ; } while (0)
+# define LOGREL(_m) do { crDebug _m ; } while (0)
+# define WARN(_m) do { crWarning _m ; AssertMsgFailed(_m); } while (0)
+# else
+# define LOG(_m) do { } while (0)
+# define LOGREL(_m) do { } while (0)
+# define WARN(_m) do { AssertMsgFailed(_m); } while (0)
+# endif
+#endif
+
+DECLEXPORT(void) crEnableWarnings(int onOff);
+
+DECLEXPORT(void) crDebug(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
+DECLEXPORT(void) crDbgCmdPrint(const char *description1, const char *description2, const char *cmd, ...);
+DECLEXPORT(void) crDbgCmdSymLoadPrint(const char *modName, const void*pvAddress);
+#if defined(DEBUG_misha) && defined(RT_OS_WINDOWS)
+typedef void FNCRDEBUG(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
+typedef FNCRDEBUG *PFNCRDEBUG;
+DECLINLINE(PFNCRDEBUG) crGetDebug() {return crDebug;}
+# define crWarning (RT_BREAKPOINT(), crDebug)
+#else
+DECLEXPORT(void) crWarning(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
+#endif
+DECLEXPORT(void) crInfo(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
+
+DECLEXPORT(void) crError(const char *format, ... ) RT_IPRT_FORMAT_ATTR(1, 2);
+
+/* Throw more info while opengl is not stable */
+#if defined(DEBUG) || 1
+# ifdef DEBUG_misha
+# include <iprt/assert.h>
+# define CRASSERT Assert
+/*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=%d, file %s, line %d", #PRED, (int)(intptr_t)(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 CRASSERT( PRED ) ((void)0)
+# define THREADASSERT( PRED ) ((void)0)
+# define CR_DDI_PROLOGUE() do {} while (0)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CR_ERROR_H */