summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/builds/win32/ftdebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/freetype2/builds/win32/ftdebug.c')
-rw-r--r--Build/source/libs/freetype2/builds/win32/ftdebug.c69
1 files changed, 52 insertions, 17 deletions
diff --git a/Build/source/libs/freetype2/builds/win32/ftdebug.c b/Build/source/libs/freetype2/builds/win32/ftdebug.c
index 886144f5920..8f7a9ab07d9 100644
--- a/Build/source/libs/freetype2/builds/win32/ftdebug.c
+++ b/Build/source/libs/freetype2/builds/win32/ftdebug.c
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component for Win32 (body). */
/* */
-/* Copyright 1996-2001, 2002, 2005 by */
+/* Copyright 1996-2001, 2002, 2005, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -48,25 +48,48 @@
#ifdef FT_DEBUG_LEVEL_ERROR
-# include <stdarg.h>
-# include <stdlib.h>
-# include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
-# include <windows.h>
+#include <windows.h>
+
+
+#ifdef _WIN32_WCE
+
+ void
+ OutputDebugStringEx( const char* str )
+ {
+ static WCHAR buf[8192];
+
+
+ int sz = MultiByteToWideChar( CP_ACP, 0, str, -1, buf,
+ sizeof ( buf ) / sizeof ( *buf ) );
+ if ( !sz )
+ lstrcpyW( buf, L"OutputDebugStringEx: MultiByteToWideChar failed" );
+
+ OutputDebugStringW( buf );
+ }
+
+#else
+
+#define OutputDebugStringEx OutputDebugStringA
+
+#endif
FT_BASE_DEF( void )
FT_Message( const char* fmt, ... )
{
- static char buf[8192];
- va_list ap;
+ static char buf[8192];
+ va_list ap;
va_start( ap, fmt );
vprintf( fmt, ap );
/* send the string to the debugger as well */
vsprintf( buf, fmt, ap );
- OutputDebugStringA( buf );
+ OutputDebugStringEx( buf );
va_end( ap );
}
@@ -74,35 +97,35 @@
FT_BASE_DEF( void )
FT_Panic( const char* fmt, ... )
{
- static char buf[8192];
- va_list ap;
+ static char buf[8192];
+ va_list ap;
va_start( ap, fmt );
vsprintf( buf, fmt, ap );
- OutputDebugStringA( buf );
+ OutputDebugStringEx( buf );
va_end( ap );
exit( EXIT_FAILURE );
}
-# ifdef FT_DEBUG_LEVEL_TRACE
+#ifdef FT_DEBUG_LEVEL_TRACE
/* array of trace levels, initialized to 0 */
int ft_trace_levels[trace_count];
/* define array of trace toggle names */
-# define FT_TRACE_DEF( x ) #x ,
+#define FT_TRACE_DEF( x ) #x ,
static const char* ft_trace_toggles[trace_count + 1] =
{
-# include FT_INTERNAL_TRACE_H
+#include FT_INTERNAL_TRACE_H
NULL
};
-# undef FT_TRACE_DEF
+#undef FT_TRACE_DEF
/*************************************************************************/
@@ -126,8 +149,19 @@
FT_BASE_DEF( void )
ft_debug_init( void )
{
+#ifdef _WIN32_WCE
+
+ /* Windows Mobile doesn't have environment API: */
+ /* GetEnvironmentStrings, GetEnvironmentVariable, getenv. */
+ /* */
+ /* FIXME!!! How to set debug mode? */
+ const char* ft2_debug = 0;
+
+#else
+
const char* ft2_debug = getenv( "FT2_DEBUG" );
+#endif
if ( ft2_debug )
{
@@ -196,7 +230,7 @@
}
-# else /* !FT_DEBUG_LEVEL_TRACE */
+#else /* !FT_DEBUG_LEVEL_TRACE */
FT_BASE_DEF( void )
@@ -206,8 +240,9 @@
}
-# endif /* !FT_DEBUG_LEVEL_TRACE */
+#endif /* !FT_DEBUG_LEVEL_TRACE */
#endif /* FT_DEBUG_LEVEL_ERROR */
+
/* END */