zenilib: zenilib/jni/external/angle/src/compiler/debug.cpp Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
debug.cpp
Go to the documentation of this file.
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 //
6
7 // debug.cpp: Debugging utilities.
8
9 #include "compiler/debug.h"
10
11 #include <stdarg.h>
12 #include <stdio.h>
13
14 #include "compiler/InitializeParseContext.h"
15 #include "compiler/ParseHelper.h"
16
17 static const int kTraceBufferLen = 1024;
18
19 #ifdef TRACE_ENABLED
20 extern "C" {
21 void Trace(const char *format, ...) {
22 if (!format) return;
23
24 TParseContext* parseContext = GetGlobalParseContext();
25 if (parseContext) {
26 char buf[kTraceBufferLen];
27 va_list args;
28 va_start(args, format);
29 vsnprintf(buf, kTraceBufferLen, format, args);
30 va_end(args);
31
32 parseContext->trace(buf);
33 }
34 }
35 } // extern "C"
36 #endif // TRACE_ENABLED
37
debug.h
TParseContext
Definition: ParseHelper.h:27
GetGlobalParseContext
TParseContext * GetGlobalParseContext()
Definition: InitializeParseContext.cpp:35
ParseHelper.h
format
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl2ext.h:845
TParseContext::trace
void trace(const char *str)
Definition: ParseHelper.cpp:200
Trace
#define Trace(...)
Definition: debug.h:31
buf
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2539
kTraceBufferLen
static const int kTraceBufferLen
Definition: debug.cpp:17
InitializeParseContext.h