Files
avolkov 62a291f2c2 Tools: map generator maintenance; added SVG output driver (from Jan Lönnberg, bug #1100); attempt to load fonts with various filename capitalization
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3665 8092fc87-c524-0410-9efc-e669fe64eaf9
2011-08-03 20:27:14 +00:00

45 lines
713 B
C

#include "port.h"
#ifndef HAVE_STRUPR
#include <ctype.h>
char *
strupr (char *str)
{
char *ptr;
ptr = str;
while (*ptr)
{
*ptr = (char) toupper (*ptr);
ptr++;
}
return str;
}
#endif
#ifdef _MSC_VER
// MSVC does not have snprintf() and vsnprintf(). It does have a _snprintf()
// and _vsnprintf(), but these do not terminate a truncated string as
// the C standard prescribes.
#include <stdio.h>
#include <stdarg.h>
int
snprintf(char *str, size_t size, const char *format, ...)
{
int result;
va_list args;
va_start (args, format);
result = _vsnprintf (str, size, format, args);
if (str != NULL && size != 0)
str[size - 1] = '\0';
va_end (args);
return result;
}
#endif /* _MSC_VER */