]> git.sesse.net Git - movit/commitdiff
Use abort() on check_error() failure.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 8 Mar 2014 20:57:04 +0000 (21:57 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 8 Mar 2014 20:57:27 +0000 (21:57 +0100)
This makes it much easier to trace them down in a debugger.

util.h

diff --git a/util.h b/util.h
index cc8256189f84872ec2f4a6b69a140352136fa390..f62618c404325ef7ef44f2b5b02326e208fc32c7 100644 (file)
--- a/util.h
+++ b/util.h
@@ -48,7 +48,7 @@ void combine_two_samples(float w1, float w2, float *offset, float *total_weight,
 #ifdef NDEBUG
 #define check_error()
 #else
-#define check_error() { int err = glGetError(); if (err != GL_NO_ERROR) { printf("GL error 0x%x at %s:%d\n", err, __FILE__, __LINE__); exit(1); } }
+#define check_error() { int err = glGetError(); if (err != GL_NO_ERROR) { printf("GL error 0x%x at %s:%d\n", err, __FILE__, __LINE__); abort(); } }
 #endif
 
 // CHECK() is like assert(), but retains any side effects no matter the compilation mode.