Configure dynamically generates SDL_config.h

I'm still wrestling with autoheader, but this should work for now...
Fixed lots of build problems with C library support disabled

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401345
This commit is contained in:
Sam Lantinga 2006-02-07 12:11:33 +00:00
parent dd8d77d906
commit 78516b5663
24 changed files with 513 additions and 117 deletions

View file

@ -25,6 +25,7 @@
#include "SDL_types.h"
#include "SDL_ctype.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
@ -175,7 +176,7 @@ static size_t SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 *valu
#endif
#endif /* SDL_HAS_64BIT_TYPE */
#ifndef HAVE_SSCANF
#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD)
static size_t SDL_ScanFloat(const char *text, double *valuep)
{
const char *textstart = text;
@ -322,6 +323,18 @@ char *SDL_strncpy(char *dst, const char *src, size_t maxlen)
}
#endif
#ifndef HAVE_STRDUP
char *SDL_strdup(const char *string)
{
size_t len = SDL_strlen(string);
char *newstr = SDL_malloc(len+1);
if ( newstr ) {
SDL_strcpy(newstr, string);
}
return newstr;
}
#endif
#ifndef HAVE__STRREV
char *SDL_strrev(char *string)
{
@ -549,6 +562,20 @@ Sint64 SDL_strtoll(const char *string, char **endp, int base)
#endif /* SDL_HAS_64BIT_TYPE */
#ifndef HAVE_STRTOD
double SDL_strtod(const char *string, char **endp)
{
size_t len;
double value;
len = SDL_ScanFloat(string, &value);
if ( endp ) {
*endp = (char *)string + len;
}
return value;
}
#endif
#ifndef HAVE_STRCMP
int SDL_strcmp(const char *str1, const char *str2)
{