gfx/angle/src/compiler/compiler_debug.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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

mercurial