From: Brian Paul Date: Mon, 10 Nov 2008 18:19:30 +0000 (-0700) Subject: Merge commit 'origin/gallium-0.1' into gallium-0.2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b66417402bc595be301ab9ed7b9ea2a5f79e180;p=mesa.git Merge commit 'origin/gallium-0.1' into gallium-0.2 Conflicts: src/gallium/auxiliary/util/u_math.c --- 2b66417402bc595be301ab9ed7b9ea2a5f79e180 diff --cc src/gallium/auxiliary/util/p_debug.c index a1a51d7ef2a,6ff3e6e0a62..0d019808b09 --- a/src/gallium/auxiliary/util/p_debug.c +++ b/src/gallium/auxiliary/util/p_debug.c @@@ -105,39 -98,13 +105,41 @@@ void _debug_vprintf(const char *format OutputDebugStringA(buf); buf[0] = '\0'; } -#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) +#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE) + wchar_t *wide_format; + long wide_str_len; + char buf[512]; + int ret; +#if (_WIN32_WCE < 600) + ret = vsprintf(buf, format, ap); + if(ret < 0){ + sprintf(buf, "Cant handle debug print!"); + ret = 25; + } +#else + ret = vsprintf_s(buf, 512, format, ap); + if(ret < 0){ + sprintf_s(buf, 512, "Cant handle debug print!"); + ret = 25; + } +#endif + buf[ret] = '\0'; + /* Format is ascii - needs to be converted to wchar_t for printing */ + wide_str_len = MultiByteToWideChar(CP_ACP, 0, (const char *) buf, -1, NULL, 0); + wide_format = (wchar_t *) malloc((wide_str_len+1) * sizeof(wchar_t)); + if (wide_format) { + MultiByteToWideChar(CP_ACP, 0, (const char *) buf, -1, + wide_format, wide_str_len); + NKDbgPrintfW(wide_format, wide_format); + free(wide_format); + } +#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) /* TODO */ #else /* !PIPE_SUBSYSTEM_WINDOWS */ + #ifdef DEBUG vfprintf(stderr, format, ap); #endif + #endif }