[Scummvm-cvs-logs] SF.net SVN: scummvm: [22980] scummvm/trunk/backends/symbian/src/portdefs.h

anotherguest at users.sourceforge.net anotherguest at users.sourceforge.net
Wed Jun 7 22:35:54 CEST 2006


Revision: 22980
Author:   anotherguest
Date:     2006-06-07 13:35:47 -0700 (Wed, 07 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22980&view=rev

Log Message:
-----------
Proper override for vsnprintf to give proper error messages

Modified Paths:
--------------
    scummvm/trunk/backends/symbian/src/portdefs.h
Modified: scummvm/trunk/backends/symbian/src/portdefs.h
===================================================================
--- scummvm/trunk/backends/symbian/src/portdefs.h	2006-06-07 18:49:20 UTC (rev 22979)
+++ scummvm/trunk/backends/symbian/src/portdefs.h	2006-06-07 20:35:47 UTC (rev 22980)
@@ -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
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list