From 60456933e75c2c3cdd436a2198010d59409d332a Mon Sep 17 00:00:00 2001 From: Lars Persson Date: Wed, 7 Jun 2006 20:35:47 +0000 Subject: Proper override for vsnprintf to give proper error messages svn-id: r22980 --- backends/symbian/src/portdefs.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/backends/symbian/src/portdefs.h b/backends/symbian/src/portdefs.h index d84db8cdd9..c31fe8caa9 100644 --- a/backends/symbian/src/portdefs.h +++ b/backends/symbian/src/portdefs.h @@ -42,10 +42,10 @@ // hack in some tricks to work around not having these fcns for Symbian // and we _really_ don't wanna link with any other windows LIBC library! -#ifdef __GCC32__ +#if defined(__GCC32__) #define snprintf(buf,len,args...) sprintf(buf,args) - #define vsnprintf snprintf + #define vsnprintf(buf,len,format,valist) vsprintf(buf,format,valist) // taken from public domain http://www.opensource.apple.com/darwinsource/WWDC2004/gcc_legacy-939/gcc/floatlib.c #define SIGNBIT 0x80000000 @@ -104,7 +104,7 @@ PS2. http://gcc.gnu.org/ml/gcc-bugs/2004-01/msg01596.html might have found out the same problem there */ -#else // WINS +#elif defined (__WINS__) // WINS // let's just blatantly ignore this for now and just get it to work :P but does n't work from the debug function int inline scumm_snprintf (char *str, unsigned long /*n*/, char const *fmt, ...) { @@ -115,8 +115,13 @@ return strlen(str); } + int inline scumm_vsnprintf (char *str, unsigned long /*n*/, char const *fmt, va_list valist) { + vsprintf(str, fmt, valist); + return strlen(str); + } + #define snprintf scumm_snprintf - #define vsnprintf scumm_snprintf + #define vsnprintf scumm_vsnprintf #endif -- cgit v1.2.3