gfx/angle/src/compiler/compiler_debug.h

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 //
michael@0 2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
michael@0 3 // Use of this source code is governed by a BSD-style license that can be
michael@0 4 // found in the LICENSE file.
michael@0 5 //
michael@0 6
michael@0 7 // compiler_debug.h: Debugging utilities.
michael@0 8
michael@0 9 #ifndef COMPILER_DEBUG_H_
michael@0 10 #define COMPILER_DEBUG_H_
michael@0 11
michael@0 12 #include <assert.h>
michael@0 13
michael@0 14 #ifdef _DEBUG
michael@0 15 #define TRACE_ENABLED // define to enable debug message tracing
michael@0 16 #endif // _DEBUG
michael@0 17
michael@0 18 // Outputs text to the debug log
michael@0 19 #ifdef TRACE_ENABLED
michael@0 20
michael@0 21 #ifdef __cplusplus
michael@0 22 extern "C" {
michael@0 23 #endif // __cplusplus
michael@0 24 void Trace(const char* format, ...);
michael@0 25 #ifdef __cplusplus
michael@0 26 }
michael@0 27 #endif // __cplusplus
michael@0 28
michael@0 29 #else // TRACE_ENABLED
michael@0 30
michael@0 31 #define Trace(...) ((void)0)
michael@0 32
michael@0 33 #endif // TRACE_ENABLED
michael@0 34
michael@0 35 // A macro asserting a condition and outputting failures to the debug log
michael@0 36 #define ASSERT(expression) do { \
michael@0 37 if(!(expression)) \
michael@0 38 Trace("Assert failed: %s(%d): "#expression"\n", __FUNCTION__, __LINE__); \
michael@0 39 assert(expression); \
michael@0 40 } while(0)
michael@0 41
michael@0 42 #define UNIMPLEMENTED() do { \
michael@0 43 Trace("Unimplemented invoked: %s(%d)\n", __FUNCTION__, __LINE__); \
michael@0 44 assert(false); \
michael@0 45 } while(0)
michael@0 46
michael@0 47 #define UNREACHABLE() do { \
michael@0 48 Trace("Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \
michael@0 49 assert(false); \
michael@0 50 } while(0)
michael@0 51
michael@0 52 #endif // COMPILER_DEBUG_H_
michael@0 53

mercurial