#include <stdio.h>
#include "errors.h"
#include "enums.h"
-#include "imports.h"
+
#include "context.h"
#include "debug_output.h"
LogFile = fopen(logFile, "w");
if (!LogFile)
LogFile = stderr;
-#ifdef DEBUG
+#ifndef NDEBUG
/* in debug builds, print messages unless MESA_DEBUG="silent" */
if (MESA_DEBUG_FLAGS & DEBUG_SILENT)
debug = 0;
fflush(LogFile);
#if defined(_WIN32)
- /* stderr from windows applications without console is not usually
- * visible, so communicate with the debugger instead */
+ /* stderr from windows applications without console is not usually
+ * visible, so communicate with the debugger instead */
{
char buf[4096];
- _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");
+ snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");
OutputDebugStringA(buf);
}
#endif
char s[MAX_DEBUG_MESSAGE_LENGTH];
if (ctx->ErrorDebugCount) {
- _mesa_snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors",
+ snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors",
ctx->ErrorDebugCount,
_mesa_enum_to_string(ctx->ErrorValue));
char str[MAX_DEBUG_MESSAGE_LENGTH];
va_list args;
va_start( args, fmtString );
- (void) _mesa_vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args );
+ (void) vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args );
va_end( args );
if (ctx)
numCalls++;
va_start( args, fmtString );
- _mesa_vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args );
+ vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args );
va_end( args );
fprintf(stderr, "Mesa " PACKAGE_VERSION " implementation error: %s\n",
str);
if (debug == -1) {
const char *debugEnv = getenv("MESA_DEBUG");
-#ifdef DEBUG
+#ifndef NDEBUG
if (debugEnv && strstr(debugEnv, "silent"))
debug = GL_FALSE;
else
_mesa_debug_get_id(id);
- len = _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
+ len = vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
if (len >= MAX_DEBUG_MESSAGE_LENGTH)
/* message was truncated */
len = MAX_DEBUG_MESSAGE_LENGTH - 1;
va_list args;
va_start(args, fmtString);
- len = _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
+ len = vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
va_end(args);
if (len >= MAX_DEBUG_MESSAGE_LENGTH) {
return;
}
- len = _mesa_snprintf(s2, MAX_DEBUG_MESSAGE_LENGTH, "%s in %s",
+ len = snprintf(s2, MAX_DEBUG_MESSAGE_LENGTH, "%s in %s",
_mesa_enum_to_string(error), s);
if (len >= MAX_DEBUG_MESSAGE_LENGTH) {
/* Same as above. */
void
_mesa_debug( const struct gl_context *ctx, const char *fmtString, ... )
{
-#ifdef DEBUG
+#ifndef NDEBUG
char s[MAX_DEBUG_MESSAGE_LENGTH];
va_list args;
va_start(args, fmtString);
- _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
+ vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
va_end(args);
output_if_debug("Mesa", s, GL_FALSE);
#endif /* DEBUG */
char s[MAX_DEBUG_MESSAGE_LENGTH];
va_list args;
va_start(args, fmtString);
- _mesa_vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
+ vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
va_end(args);
output_if_debug("", s, GL_FALSE);
}