It's now possible to build SDL without any C runtime at all on Windows,
using Visual C++ 2005 --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401334
This commit is contained in:
parent
5372bfd326
commit
6c3f928cd8
101 changed files with 8882 additions and 601 deletions
|
@ -22,13 +22,9 @@
|
|||
|
||||
/* Simple error handling in SDL */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "SDL_types.h"
|
||||
#include "SDL_getenv.h"
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_error_c.h"
|
||||
#ifndef DISABLE_THREADS
|
||||
|
@ -42,10 +38,6 @@ static SDL_error SDL_global_error;
|
|||
#define SDL_GetErrBuf() (&SDL_global_error)
|
||||
#endif /* DISABLE_THREADS */
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#define DISABLE_STDIO
|
||||
#endif
|
||||
|
||||
#define SDL_ERRBUFIZE 1024
|
||||
|
||||
/* Private functions */
|
||||
|
@ -121,16 +113,10 @@ void SDL_SetError (const char *fmt, ...)
|
|||
}
|
||||
va_end(ap);
|
||||
|
||||
#ifndef DISABLE_STDIO
|
||||
/* If we are in debug mode, print out an error message */
|
||||
#ifdef DEBUG_ERROR
|
||||
fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
|
||||
#else
|
||||
if ( getenv("SDL_DEBUG") ) {
|
||||
fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
|
||||
}
|
||||
#endif
|
||||
#endif /* !DISABLE_STDIO */
|
||||
}
|
||||
|
||||
/* Print out an integer value to a UNICODE buffer */
|
||||
|
@ -139,7 +125,7 @@ static int PrintInt(Uint16 *str, unsigned int maxlen, int value)
|
|||
char tmp[128];
|
||||
int len, i;
|
||||
|
||||
sprintf(tmp, "%d", value);
|
||||
snprintf(tmp, SDL_arraysize(tmp), "%d", value);
|
||||
len = 0;
|
||||
if ( strlen(tmp) < maxlen ) {
|
||||
for ( i=0; tmp[i]; ++i ) {
|
||||
|
@ -155,7 +141,7 @@ static int PrintDouble(Uint16 *str, unsigned int maxlen, double value)
|
|||
char tmp[128];
|
||||
int len, i;
|
||||
|
||||
sprintf(tmp, "%f", value);
|
||||
snprintf(tmp, SDL_arraysize(tmp), "%f", value);
|
||||
len = 0;
|
||||
if ( strlen(tmp) < maxlen ) {
|
||||
for ( i=0; tmp[i]; ++i ) {
|
||||
|
@ -171,7 +157,7 @@ static int PrintPointer(Uint16 *str, unsigned int maxlen, void *value)
|
|||
char tmp[128];
|
||||
int len, i;
|
||||
|
||||
sprintf(tmp, "%p", value);
|
||||
snprintf(tmp, SDL_arraysize(tmp), "%p", value);
|
||||
len = 0;
|
||||
if ( strlen(tmp) < maxlen ) {
|
||||
for ( i=0; tmp[i]; ++i ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue