Configure dynamically generates SDL_config.h
authorSam Lantinga <slouken@libsdl.org>
Tue, 07 Feb 2006 12:11:33 +0000
changeset 1341d02b552e5304
parent 1340 58b114ef50e7
child 1342 d73be99e9420
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
autogen.sh
configure.in
include/Makefile.am
include/SDL_config.h
include/SDL_config.h.in
include/SDL_config.h.minimal
include/SDL_stdlib.h
include/SDL_string.h
src/audio/SDL_audio.c
src/audio/amigaos/SDL_ahiaudio.c
src/audio/disk/SDL_diskaudio.c
src/audio/dma/SDL_dmaaudio.c
src/audio/dsp/SDL_dspaudio.c
src/audio/mme/SDL_mmeaudio.h
src/cdrom/linux/SDL_syscdrom.c
src/stdlib/SDL_getenv.c
src/stdlib/SDL_string.c
src/video/SDL_video.c
src/video/SDL_yuv.c
src/video/fbcon/SDL_fbelo.c
src/video/fbcon/SDL_fbevents.c
src/video/fbcon/SDL_fbvideo.c
src/video/nanox/SDL_nxvideo.c
src/video/wincommon/SDL_sysevents.c
     1.1 --- a/autogen.sh	Tue Feb 07 11:18:21 2006 +0000
     1.2 +++ b/autogen.sh	Tue Feb 07 12:11:33 2006 +0000
     1.3 @@ -6,6 +6,7 @@
     1.4  # Touch the timestamps on all the files since CVS messes them up
     1.5  directory=`dirname $0`
     1.6  touch $directory/configure.in
     1.7 +touch $directory/include/SDL_config.h.in
     1.8  
     1.9  # Regenerate configuration files
    1.10  aclocal || exit 1
     2.1 --- a/configure.in	Tue Feb 07 11:18:21 2006 +0000
     2.2 +++ b/configure.in	Tue Feb 07 12:11:33 2006 +0000
     2.3 @@ -1,5 +1,42 @@
     2.4  dnl Process this file with autoconf to produce a configure script.
     2.5  AC_INIT(README)
     2.6 +AH_TOP([/*
     2.7 +    SDL - Simple DirectMedia Layer
     2.8 +    Copyright (C) 1997-2006 Sam Lantinga
     2.9 +
    2.10 +    This library is free software; you can redistribute it and/or
    2.11 +    modify it under the terms of the GNU Lesser General Public
    2.12 +    License as published by the Free Software Foundation; either
    2.13 +    version 2.1 of the License, or (at your option) any later version.
    2.14 +
    2.15 +    This library is distributed in the hope that it will be useful,
    2.16 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.17 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.18 +    Lesser General Public License for more details.
    2.19 +
    2.20 +    You should have received a copy of the GNU Lesser General Public
    2.21 +    License along with this library; if not, write to the Free Software
    2.22 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2.23 +
    2.24 +    Sam Lantinga
    2.25 +    slouken@libsdl.org
    2.26 +*/
    2.27 +
    2.28 +#ifndef _SDL_config_h
    2.29 +#define _SDL_config_h
    2.30 +
    2.31 +/* This is a set of defines to configure the SDL features */
    2.32 +
    2.33 +/* Comment this if you want to build without any libc requirements */
    2.34 +#undef HAVE_LIBC
    2.35 +#ifdef HAVE_LIBC
    2.36 +])
    2.37 +AC_CONFIG_HEADER(include/SDL_config.h)
    2.38 +AH_BOTTOM([
    2.39 +#endif /* HAVE_LIBC */
    2.40 +
    2.41 +#endif /* _SDL_config_h */
    2.42 +])
    2.43  
    2.44  dnl Set various version strings - taken gratefully from the GTk sources
    2.45  #
    2.46 @@ -113,6 +150,40 @@
    2.47      fi
    2.48  fi
    2.49  
    2.50 +dnl See whether we are allowed to use the system C library
    2.51 +AC_ARG_ENABLE(libc,
    2.52 +[  --enable-libc           Use the system C library [default=yes]],
    2.53 +              , AC_DEFINE(HAVE_LIBC))
    2.54 +
    2.55 +dnl Checks for header files.
    2.56 +AC_CHECK_HEADERS(alloca.h stdint.h stdlib.h stdarg.h malloc.h)
    2.57 +AC_CHECK_HEADERS(ctype.h)
    2.58 +AC_CHECK_HEADERS(string.h)
    2.59 +AC_CHECK_HEADERS(stdio.h)
    2.60 +AC_CHECK_HEADERS(signal.h)
    2.61 +
    2.62 +dnl Checks for typedefs, structures, and compiler characteristics.
    2.63 +AC_C_CONST
    2.64 +AC_C_INLINE
    2.65 +AC_TYPE_SIZE_T
    2.66 +AC_CHECK_SIZEOF(char, 1)
    2.67 +AC_CHECK_SIZEOF(short, 2)
    2.68 +AC_CHECK_SIZEOF(int, 4)
    2.69 +AC_CHECK_SIZEOF(long, 4)
    2.70 +AC_CHECK_SIZEOF(long long, 8)
    2.71 +
    2.72 +dnl Checks for library functions.
    2.73 +AC_FUNC_ALLOCA
    2.74 +AC_CHECK_FUNCS(malloc calloc realloc free)
    2.75 +AC_CHECK_FUNCS(getenv putenv qsort abs)
    2.76 +AC_CHECK_FUNCS(memset memcpy memmove memcmp)
    2.77 +AC_CHECK_FUNCS(strlen strcpy strncpy strcat strncat strdup)
    2.78 +AC_CHECK_FUNCS(_strrev _strupr _strlwr)
    2.79 +AC_CHECK_FUNCS(strchr strrchr strstr)
    2.80 +AC_CHECK_FUNCS(itoa _ltoa _uitoa _ultoa strtol _i64toa _ui64toa strtoll atoi atof)
    2.81 +AC_CHECK_FUNCS(strcmp strncmp stricmp strcasecmp)
    2.82 +AC_CHECK_FUNCS(sscanf snprintf vsnprintf)
    2.83 +
    2.84  dnl Initialize the compiler and linker flags for SDL applications
    2.85  
    2.86  SDL_CFLAGS=""
     3.1 --- a/include/Makefile.am	Tue Feb 07 11:18:21 2006 +0000
     3.2 +++ b/include/Makefile.am	Tue Feb 07 12:11:33 2006 +0000
     3.3 @@ -41,3 +41,7 @@
     3.4  	SDL_windows.h		\
     3.5  	begin_code.h		\
     3.6  	close_code.h
     3.7 +
     3.8 +EXTRA_DIST =			\
     3.9 +	SDL_config.h.in		\
    3.10 +	SDL_config.h.minimal
     4.1 --- a/include/SDL_config.h	Tue Feb 07 11:18:21 2006 +0000
     4.2 +++ b/include/SDL_config.h	Tue Feb 07 12:11:33 2006 +0000
     4.3 @@ -23,81 +23,8 @@
     4.4  #ifndef _SDL_config_h
     4.5  #define _SDL_config_h
     4.6  
     4.7 -/* This is a set of defines to configure the SDL features */
     4.8 +/* This is the minimal configuration that can be used to build SDL */
     4.9  
    4.10 -#define HAVE_STDARG_H
    4.11 -
    4.12 -/* Comment this if you want to build without any libc requirements */
    4.13 -#define HAVE_LIBC
    4.14 -#ifdef HAVE_LIBC
    4.15 -
    4.16 -/* Various C library headers */
    4.17 -#ifndef HAVE_CTYPE_H
    4.18 -#define HAVE_CTYPE_H
    4.19 -#endif
    4.20 -#ifndef HAVE_STDIO_H
    4.21 -#define HAVE_STDIO_H
    4.22 -#endif
    4.23 -#ifndef HAVE_STDLIB_H
    4.24 -#define HAVE_STDLIB_H
    4.25 -#endif
    4.26 -#ifndef HAVE_MALLOC_H
    4.27 -#define HAVE_MALLOC_H
    4.28 -#endif
    4.29 -#ifndef HAVE_STRING_H
    4.30 -#define HAVE_STRING_H
    4.31 -#endif
    4.32 -#if !defined(_WIN32_WCE)
    4.33 -#ifndef HAVE_SIGNAL_H
    4.34 -#define HAVE_SIGNAL_H
    4.35 -#endif
    4.36 -#endif /* !_WIN32_WCE */
    4.37 -
    4.38 -/* Features provided by SDL_stdlib.h */
    4.39 -#define HAVE_MALLOC
    4.40 -#define HAVE_REALLOC
    4.41 -#define HAVE_FREE
    4.42 -#ifndef HAVE_ALLOCA
    4.43 -#define HAVE_ALLOCA
    4.44 -#endif
    4.45 -#if !defined(_WIN32) /* Don't use C runtime versions of these on Windows */
    4.46 -#define HAVE_GETENV
    4.47 -#define HAVE_PUTENV
    4.48 -#endif
    4.49 -/*#define HAVE_QSORT*/
    4.50 -
    4.51 -/* Features provided by SDL_string.h */
    4.52 -#define HAVE_MEMSET
    4.53 -#define HAVE_MEMCPY
    4.54 -#define HAVE_MEMMOVE
    4.55 -#define HAVE_MEMCMP
    4.56 -#define HAVE_STRLEN
    4.57 -#define HAVE_STRCPY
    4.58 -#define HAVE_STRNCPY
    4.59 -#define HAVE_STRCAT
    4.60 -#define HAVE_STRNCAT
    4.61 -/*#define HAVE__STRREV*/
    4.62 -/*#define HAVE__STRUPR*/
    4.63 -/*#define HAVE__STRLWR*/
    4.64 -#define HAVE_STRCHR
    4.65 -#define HAVE_STRRCHR
    4.66 -#define HAVE_STRSTR
    4.67 -/*#define HAVE_ITOA*/
    4.68 -/*#define HAVE__LTOA*/
    4.69 -/*#define HAVE__UITOA*/
    4.70 -/*#define HAVE__ULTOA*/
    4.71 -/*#define HAVE_STRTOL*/
    4.72 -/*#define HAVE__I64TOA*/
    4.73 -/*#define HAVE__UI64TOA*/
    4.74 -/*#define HAVE_STRTOLL*/
    4.75 -#define HAVE_STRCMP
    4.76 -#define HAVE_STRNCMP
    4.77 -/*#define HAVE_STRICMP*/
    4.78 -/*#define HAVE_STRCASECMP*/
    4.79 -#define HAVE_SSCANF
    4.80 -/*#define HAVE_SNPRINTF*/
    4.81 -/*#define HAVE_VSNPRINTF*/
    4.82 -
    4.83 -#endif /* HAVE_LIBC */
    4.84 +#define HAVE_STDARG_H 1
    4.85  
    4.86  #endif /* _SDL_config_h */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/include/SDL_config.h.in	Tue Feb 07 12:11:33 2006 +0000
     5.3 @@ -0,0 +1,289 @@
     5.4 +/* include/SDL_config.h.in.  Generated from configure.in by autoheader.  */
     5.5 +
     5.6 +/*
     5.7 +    SDL - Simple DirectMedia Layer
     5.8 +    Copyright (C) 1997-2006 Sam Lantinga
     5.9 +
    5.10 +    This library is free software; you can redistribute it and/or
    5.11 +    modify it under the terms of the GNU Lesser General Public
    5.12 +    License as published by the Free Software Foundation; either
    5.13 +    version 2.1 of the License, or (at your option) any later version.
    5.14 +
    5.15 +    This library is distributed in the hope that it will be useful,
    5.16 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.17 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.18 +    Lesser General Public License for more details.
    5.19 +
    5.20 +    You should have received a copy of the GNU Lesser General Public
    5.21 +    License along with this library; if not, write to the Free Software
    5.22 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    5.23 +
    5.24 +    Sam Lantinga
    5.25 +    slouken@libsdl.org
    5.26 +*/
    5.27 +
    5.28 +#ifndef _SDL_config_h
    5.29 +#define _SDL_config_h
    5.30 +
    5.31 +/* This is a set of defines to configure the SDL features */
    5.32 +
    5.33 +/* Comment this if you want to build without any libc requirements */
    5.34 +#undef HAVE_LIBC
    5.35 +#ifdef HAVE_LIBC
    5.36 +
    5.37 +
    5.38 +
    5.39 +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
    5.40 +   systems. This function is required for `alloca.c' support on those systems.
    5.41 +   */
    5.42 +#undef CRAY_STACKSEG_END
    5.43 +
    5.44 +/* Define to 1 if using `alloca.c'. */
    5.45 +#undef C_ALLOCA
    5.46 +
    5.47 +/* Define to 1 if you have the `abs' function. */
    5.48 +#undef HAVE_ABS
    5.49 +
    5.50 +/* Define to 1 if you have `alloca', as a function or macro. */
    5.51 +#undef HAVE_ALLOCA
    5.52 +
    5.53 +/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
    5.54 +   */
    5.55 +#undef HAVE_ALLOCA_H
    5.56 +
    5.57 +/* Define to 1 if you have the `atof' function. */
    5.58 +#undef HAVE_ATOF
    5.59 +
    5.60 +/* Define to 1 if you have the `atoi' function. */
    5.61 +#undef HAVE_ATOI
    5.62 +
    5.63 +/* Define to 1 if you have the `calloc' function. */
    5.64 +#undef HAVE_CALLOC
    5.65 +
    5.66 +/* Define to 1 if you have the <ctype.h> header file. */
    5.67 +#undef HAVE_CTYPE_H
    5.68 +
    5.69 +/* Define to 1 if you have the <dlfcn.h> header file. */
    5.70 +#undef HAVE_DLFCN_H
    5.71 +
    5.72 +/* Define to 1 if you have the `free' function. */
    5.73 +#undef HAVE_FREE
    5.74 +
    5.75 +/* Define to 1 if you have the `getenv' function. */
    5.76 +#undef HAVE_GETENV
    5.77 +
    5.78 +/* Define to 1 if you have the <inttypes.h> header file. */
    5.79 +#undef HAVE_INTTYPES_H
    5.80 +
    5.81 +/* Define to 1 if you have the `itoa' function. */
    5.82 +#undef HAVE_ITOA
    5.83 +
    5.84 +/* Define to 1 if you have the `asound' library (-lasound). */
    5.85 +#undef HAVE_LIBASOUND
    5.86 +
    5.87 +/* Define to 1 if you have the `malloc' function. */
    5.88 +#undef HAVE_MALLOC
    5.89 +
    5.90 +/* Define to 1 if you have the <malloc.h> header file. */
    5.91 +#undef HAVE_MALLOC_H
    5.92 +
    5.93 +/* Define to 1 if you have the `memcmp' function. */
    5.94 +#undef HAVE_MEMCMP
    5.95 +
    5.96 +/* Define to 1 if you have the `memcpy' function. */
    5.97 +#undef HAVE_MEMCPY
    5.98 +
    5.99 +/* Define to 1 if you have the `memmove' function. */
   5.100 +#undef HAVE_MEMMOVE
   5.101 +
   5.102 +/* Define to 1 if you have the <memory.h> header file. */
   5.103 +#undef HAVE_MEMORY_H
   5.104 +
   5.105 +/* Define to 1 if you have the `memset' function. */
   5.106 +#undef HAVE_MEMSET
   5.107 +
   5.108 +/* Define to 1 if you have the `putenv' function. */
   5.109 +#undef HAVE_PUTENV
   5.110 +
   5.111 +/* Define to 1 if you have the `qsort' function. */
   5.112 +#undef HAVE_QSORT
   5.113 +
   5.114 +/* Define to 1 if you have the `realloc' function. */
   5.115 +#undef HAVE_REALLOC
   5.116 +
   5.117 +/* Define to 1 if you have the <signal.h> header file. */
   5.118 +#undef HAVE_SIGNAL_H
   5.119 +
   5.120 +/* Define to 1 if you have the `snprintf' function. */
   5.121 +#undef HAVE_SNPRINTF
   5.122 +
   5.123 +/* Define to 1 if you have the `sscanf' function. */
   5.124 +#undef HAVE_SSCANF
   5.125 +
   5.126 +/* Define to 1 if you have the <stdarg.h> header file. */
   5.127 +#undef HAVE_STDARG_H
   5.128 +
   5.129 +/* Define to 1 if you have the <stdint.h> header file. */
   5.130 +#undef HAVE_STDINT_H
   5.131 +
   5.132 +/* Define to 1 if you have the <stdio.h> header file. */
   5.133 +#undef HAVE_STDIO_H
   5.134 +
   5.135 +/* Define to 1 if you have the <stdlib.h> header file. */
   5.136 +#undef HAVE_STDLIB_H
   5.137 +
   5.138 +/* Define to 1 if you have the `strcasecmp' function. */
   5.139 +#undef HAVE_STRCASECMP
   5.140 +
   5.141 +/* Define to 1 if you have the `strcat' function. */
   5.142 +#undef HAVE_STRCAT
   5.143 +
   5.144 +/* Define to 1 if you have the `strchr' function. */
   5.145 +#undef HAVE_STRCHR
   5.146 +
   5.147 +/* Define to 1 if you have the `strcmp' function. */
   5.148 +#undef HAVE_STRCMP
   5.149 +
   5.150 +/* Define to 1 if you have the `strcpy' function. */
   5.151 +#undef HAVE_STRCPY
   5.152 +
   5.153 +/* Define to 1 if you have the `strdup' function. */
   5.154 +#undef HAVE_STRDUP
   5.155 +
   5.156 +/* Define to 1 if you have the `stricmp' function. */
   5.157 +#undef HAVE_STRICMP
   5.158 +
   5.159 +/* Define to 1 if you have the <strings.h> header file. */
   5.160 +#undef HAVE_STRINGS_H
   5.161 +
   5.162 +/* Define to 1 if you have the <string.h> header file. */
   5.163 +#undef HAVE_STRING_H
   5.164 +
   5.165 +/* Define to 1 if you have the `strlen' function. */
   5.166 +#undef HAVE_STRLEN
   5.167 +
   5.168 +/* Define to 1 if you have the `strncat' function. */
   5.169 +#undef HAVE_STRNCAT
   5.170 +
   5.171 +/* Define to 1 if you have the `strncmp' function. */
   5.172 +#undef HAVE_STRNCMP
   5.173 +
   5.174 +/* Define to 1 if you have the `strncpy' function. */
   5.175 +#undef HAVE_STRNCPY
   5.176 +
   5.177 +/* Define to 1 if you have the `strrchr' function. */
   5.178 +#undef HAVE_STRRCHR
   5.179 +
   5.180 +/* Define to 1 if you have the `strstr' function. */
   5.181 +#undef HAVE_STRSTR
   5.182 +
   5.183 +/* Define to 1 if you have the `strtol' function. */
   5.184 +#undef HAVE_STRTOL
   5.185 +
   5.186 +/* Define to 1 if you have the `strtoll' function. */
   5.187 +#undef HAVE_STRTOLL
   5.188 +
   5.189 +/* Define to 1 if you have the <sys/stat.h> header file. */
   5.190 +#undef HAVE_SYS_STAT_H
   5.191 +
   5.192 +/* Define to 1 if you have the <sys/types.h> header file. */
   5.193 +#undef HAVE_SYS_TYPES_H
   5.194 +
   5.195 +/* Define to 1 if you have the <unistd.h> header file. */
   5.196 +#undef HAVE_UNISTD_H
   5.197 +
   5.198 +/* Define to 1 if you have the `vsnprintf' function. */
   5.199 +#undef HAVE_VSNPRINTF
   5.200 +
   5.201 +/* Define to 1 if you have the `_i64toa' function. */
   5.202 +#undef HAVE__I64TOA
   5.203 +
   5.204 +/* Define to 1 if you have the `_ltoa' function. */
   5.205 +#undef HAVE__LTOA
   5.206 +
   5.207 +/* Define to 1 if you have the `_strlwr' function. */
   5.208 +#undef HAVE__STRLWR
   5.209 +
   5.210 +/* Define to 1 if you have the `_strrev' function. */
   5.211 +#undef HAVE__STRREV
   5.212 +
   5.213 +/* Define to 1 if you have the `_strupr' function. */
   5.214 +#undef HAVE__STRUPR
   5.215 +
   5.216 +/* Define to 1 if you have the `_ui64toa' function. */
   5.217 +#undef HAVE__UI64TOA
   5.218 +
   5.219 +/* Define to 1 if you have the `_uitoa' function. */
   5.220 +#undef HAVE__UITOA
   5.221 +
   5.222 +/* Define to 1 if you have the `_ultoa' function. */
   5.223 +#undef HAVE__ULTOA
   5.224 +
   5.225 +/* Name of package */
   5.226 +#undef PACKAGE
   5.227 +
   5.228 +/* Define to the address where bug reports for this package should be sent. */
   5.229 +#undef PACKAGE_BUGREPORT
   5.230 +
   5.231 +/* Define to the full name of this package. */
   5.232 +#undef PACKAGE_NAME
   5.233 +
   5.234 +/* Define to the full name and version of this package. */
   5.235 +#undef PACKAGE_STRING
   5.236 +
   5.237 +/* Define to the one symbol short name of this package. */
   5.238 +#undef PACKAGE_TARNAME
   5.239 +
   5.240 +/* Define to the version of this package. */
   5.241 +#undef PACKAGE_VERSION
   5.242 +
   5.243 +/* The size of a `char', as computed by sizeof. */
   5.244 +#undef SIZEOF_CHAR
   5.245 +
   5.246 +/* The size of a `int', as computed by sizeof. */
   5.247 +#undef SIZEOF_INT
   5.248 +
   5.249 +/* The size of a `long', as computed by sizeof. */
   5.250 +#undef SIZEOF_LONG
   5.251 +
   5.252 +/* The size of a `long long', as computed by sizeof. */
   5.253 +#undef SIZEOF_LONG_LONG
   5.254 +
   5.255 +/* The size of a `short', as computed by sizeof. */
   5.256 +#undef SIZEOF_SHORT
   5.257 +
   5.258 +/* If using the C implementation of alloca, define if you know the
   5.259 +   direction of stack growth for your system; otherwise it will be
   5.260 +   automatically deduced at run-time.
   5.261 +	STACK_DIRECTION > 0 => grows toward higher addresses
   5.262 +	STACK_DIRECTION < 0 => grows toward lower addresses
   5.263 +	STACK_DIRECTION = 0 => direction of growth unknown */
   5.264 +#undef STACK_DIRECTION
   5.265 +
   5.266 +/* Define to 1 if you have the ANSI C header files. */
   5.267 +#undef STDC_HEADERS
   5.268 +
   5.269 +/* Version number of package */
   5.270 +#undef VERSION
   5.271 +
   5.272 +/* Define to 1 if the X Window System is missing or not being used. */
   5.273 +#undef X_DISPLAY_MISSING
   5.274 +
   5.275 +/* Define to empty if `const' does not conform to ANSI C. */
   5.276 +#undef const
   5.277 +
   5.278 +/* Define to `__inline__' or `__inline' if that's what the C compiler
   5.279 +   calls it, or to nothing if 'inline' is not supported under any name.  */
   5.280 +#ifndef __cplusplus
   5.281 +#undef inline
   5.282 +#endif
   5.283 +
   5.284 +/* Define to `unsigned' if <sys/types.h> does not define. */
   5.285 +#undef size_t
   5.286 +
   5.287 +
   5.288 +
   5.289 +#endif /* HAVE_LIBC */
   5.290 +
   5.291 +#endif /* _SDL_config_h */
   5.292 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/include/SDL_config.h.minimal	Tue Feb 07 12:11:33 2006 +0000
     6.3 @@ -0,0 +1,30 @@
     6.4 +/*
     6.5 +    SDL - Simple DirectMedia Layer
     6.6 +    Copyright (C) 1997-2006 Sam Lantinga
     6.7 +
     6.8 +    This library is free software; you can redistribute it and/or
     6.9 +    modify it under the terms of the GNU Lesser General Public
    6.10 +    License as published by the Free Software Foundation; either
    6.11 +    version 2.1 of the License, or (at your option) any later version.
    6.12 +
    6.13 +    This library is distributed in the hope that it will be useful,
    6.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.16 +    Lesser General Public License for more details.
    6.17 +
    6.18 +    You should have received a copy of the GNU Lesser General Public
    6.19 +    License along with this library; if not, write to the Free Software
    6.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    6.21 +
    6.22 +    Sam Lantinga
    6.23 +    slouken@libsdl.org
    6.24 +*/
    6.25 +
    6.26 +#ifndef _SDL_config_h
    6.27 +#define _SDL_config_h
    6.28 +
    6.29 +/* This is the minimal configuration that can be used to build SDL */
    6.30 +
    6.31 +#define HAVE_STDARG_H 1
    6.32 +
    6.33 +#endif /* _SDL_config_h */
     7.1 --- a/include/SDL_stdlib.h	Tue Feb 07 11:18:21 2006 +0000
     7.2 +++ b/include/SDL_stdlib.h	Tue Feb 07 12:11:33 2006 +0000
     7.3 @@ -62,6 +62,12 @@
     7.4  extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
     7.5  #endif
     7.6  
     7.7 +#ifdef HAVE_CALLOC
     7.8 +#define SDL_calloc	calloc
     7.9 +#else
    7.10 +extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
    7.11 +#endif
    7.12 +
    7.13  #ifdef HAVE_REALLOC
    7.14  #define SDL_realloc	realloc
    7.15  #else
    7.16 @@ -101,6 +107,12 @@
    7.17             int (*compare)(const void *, const void *));
    7.18  #endif
    7.19  
    7.20 +#ifdef HAVE_ABS
    7.21 +#define SDL_abs		abs
    7.22 +#else
    7.23 +#define SDL_abs(X)	((X) < 0 ? -(X) : (X))
    7.24 +#endif
    7.25 +
    7.26  /* Ends C function definitions when using C++ */
    7.27  #ifdef __cplusplus
    7.28  }
     8.1 --- a/include/SDL_string.h	Tue Feb 07 11:18:21 2006 +0000
     8.2 +++ b/include/SDL_string.h	Tue Feb 07 12:11:33 2006 +0000
     8.3 @@ -201,6 +201,12 @@
     8.4  #define SDL_strncat(dst, src, n) (SDL_strncpy(dst+SDL_strlen(dst), src, n), dst)
     8.5  #endif
     8.6  
     8.7 +#ifdef HAVE_STRDUP
     8.8 +#define SDL_strdup     strdup
     8.9 +#else
    8.10 +extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
    8.11 +#endif
    8.12 +
    8.13  #ifdef HAVE__STRREV
    8.14  #define SDL_strrev      _strrev
    8.15  #else
    8.16 @@ -289,6 +295,24 @@
    8.17  
    8.18  #endif /* SDL_HAS_64BIT_TYPE */
    8.19  
    8.20 +#ifdef HAVE_STRTOD
    8.21 +#define SDL_strtod      strtod
    8.22 +#else
    8.23 +extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
    8.24 +#endif
    8.25 +
    8.26 +#ifdef HAVE_ATOI
    8.27 +#define SDL_atoi        atoi
    8.28 +#else
    8.29 +#define SDL_atoi(X)     SDL_strtol(X, NULL, 0)
    8.30 +#endif
    8.31 +
    8.32 +#ifdef HAVE_ATOF
    8.33 +#define SDL_atof        atof
    8.34 +#else
    8.35 +#define SDL_atof(X)     SDL_strtod(X, NULL)
    8.36 +#endif
    8.37 +
    8.38  #ifdef HAVE_STRCMP
    8.39  #define SDL_strcmp      strcmp
    8.40  #else
     9.1 --- a/src/audio/SDL_audio.c	Tue Feb 07 11:18:21 2006 +0000
     9.2 +++ b/src/audio/SDL_audio.c	Tue Feb 07 12:11:33 2006 +0000
     9.3 @@ -306,18 +306,20 @@
     9.4  		 */
     9.5  		for ( i=0; bootstrap[i]; ++i ) {
     9.6  			if ( SDL_strcmp(bootstrap[i]->name, "esd") == 0 ) {
     9.7 +#ifdef HAVE_PUTENV
     9.8  				const char *esd_no_spawn;
     9.9  
    9.10  				/* Don't start ESD if it's not running */
    9.11 -				esd_no_spawn = SDL_getenv("ESD_NO_SPAWN");
    9.12 +				esd_no_spawn = getenv("ESD_NO_SPAWN");
    9.13  				if ( esd_no_spawn == NULL ) {
    9.14  					putenv("ESD_NO_SPAWN=1");
    9.15  				}
    9.16 +#endif
    9.17  				if ( bootstrap[i]->available() ) {
    9.18  					audio = bootstrap[i]->create(0);
    9.19  					break;
    9.20  				}
    9.21 -#ifdef linux	/* No unsetenv() on most platforms */
    9.22 +#ifdef HAVE_UNSETENV
    9.23  				if ( esd_no_spawn == NULL ) {
    9.24  					unsetenv("ESD_NO_SPAWN");
    9.25  				}
    10.1 --- a/src/audio/amigaos/SDL_ahiaudio.c	Tue Feb 07 11:18:21 2006 +0000
    10.2 +++ b/src/audio/amigaos/SDL_ahiaudio.c	Tue Feb 07 12:11:33 2006 +0000
    10.3 @@ -22,6 +22,8 @@
    10.4  
    10.5  /* Allow access to a raw mixing buffer (for AmigaOS) */
    10.6  
    10.7 +#include "SDL_stdlib.h"
    10.8 +#include "SDL_string.h"
    10.9  #include "SDL_endian.h"
   10.10  #include "SDL_audio.h"
   10.11  #include "SDL_audiomem.h"
    11.1 --- a/src/audio/disk/SDL_diskaudio.c	Tue Feb 07 11:18:21 2006 +0000
    11.2 +++ b/src/audio/disk/SDL_diskaudio.c	Tue Feb 07 12:11:33 2006 +0000
    11.3 @@ -26,6 +26,7 @@
    11.4  /* Output raw audio data to a file. */
    11.5  
    11.6  #include <stdio.h>
    11.7 +#include <string.h>	/* For strerror() */
    11.8  #include <errno.h>
    11.9  #include <unistd.h>
   11.10  #include <sys/stat.h>
   11.11 @@ -130,7 +131,7 @@
   11.12  	SDL_memset(this->hidden, 0, (sizeof *this->hidden));
   11.13  
   11.14      envr = SDL_getenv(DISKENVR_WRITEDELAY);
   11.15 -    this->hidden->write_delay = (envr) ? atoi(envr) : DISKDEFAULT_WRITEDELAY;
   11.16 +    this->hidden->write_delay = (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY;
   11.17  
   11.18  	/* Set the function pointers */
   11.19  	this->OpenAudio = DISKAUD_OpenAudio;
    12.1 --- a/src/audio/dma/SDL_dmaaudio.c	Tue Feb 07 11:18:21 2006 +0000
    12.2 +++ b/src/audio/dma/SDL_dmaaudio.c	Tue Feb 07 12:11:33 2006 +0000
    12.3 @@ -23,6 +23,7 @@
    12.4  /* Allow access to a raw mixing buffer */
    12.5  
    12.6  #include <stdio.h>
    12.7 +#include <string.h>	/* For strerror() */
    12.8  #include <errno.h>
    12.9  #include <unistd.h>
   12.10  #include <fcntl.h>
    13.1 --- a/src/audio/dsp/SDL_dspaudio.c	Tue Feb 07 11:18:21 2006 +0000
    13.2 +++ b/src/audio/dsp/SDL_dspaudio.c	Tue Feb 07 12:11:33 2006 +0000
    13.3 @@ -25,7 +25,8 @@
    13.4  
    13.5  /* Allow access to a raw mixing buffer */
    13.6  
    13.7 -#include <stdio.h>	/* For perror() ... should we really do this? */
    13.8 +#include <stdio.h>	/* For perror() */
    13.9 +#include <string.h>	/* For strerror() */
   13.10  #include <errno.h>
   13.11  #include <unistd.h>
   13.12  #include <fcntl.h>
    14.1 --- a/src/audio/mme/SDL_mmeaudio.h	Tue Feb 07 11:18:21 2006 +0000
    14.2 +++ b/src/audio/mme/SDL_mmeaudio.h	Tue Feb 07 12:11:33 2006 +0000
    14.3 @@ -24,6 +24,8 @@
    14.4  
    14.5  #include <mme_api.h>
    14.6  
    14.7 +#include "SDL_stdlib.h"
    14.8 +#include "SDL_string.h"
    14.9  #include "SDL_audio.h"
   14.10  #include "SDL_mutex.h"
   14.11  #include "SDL_timer.h"
    15.1 --- a/src/cdrom/linux/SDL_syscdrom.c	Tue Feb 07 11:18:21 2006 +0000
    15.2 +++ b/src/cdrom/linux/SDL_syscdrom.c	Tue Feb 07 12:11:33 2006 +0000
    15.3 @@ -22,6 +22,7 @@
    15.4  
    15.5  /* Functions for system-level CD-ROM audio control */
    15.6  
    15.7 +#include <string.h>	/* For strerror() */
    15.8  #include <sys/types.h>
    15.9  #include <sys/stat.h>
   15.10  #include <sys/ioctl.h>
   15.11 @@ -215,7 +216,7 @@
   15.12  				tmp = SDL_strstr(mntent->mnt_opts, "fs=");
   15.13  				if ( tmp ) {
   15.14  					SDL_free(mnt_type);
   15.15 -					mnt_type = strdup(tmp + SDL_strlen("fs="));
   15.16 +					mnt_type = SDL_strdup(tmp + SDL_strlen("fs="));
   15.17  					if ( mnt_type ) {
   15.18  						tmp = SDL_strchr(mnt_type, ',');
   15.19  						if ( tmp ) {
   15.20 @@ -226,7 +227,7 @@
   15.21  				tmp = SDL_strstr(mntent->mnt_opts, "dev=");
   15.22  				if ( tmp ) {
   15.23  					SDL_free(mnt_dev);
   15.24 -					mnt_dev = strdup(tmp + SDL_strlen("dev="));
   15.25 +					mnt_dev = SDL_strdup(tmp + SDL_strlen("dev="));
   15.26  					if ( mnt_dev ) {
   15.27  						tmp = SDL_strchr(mnt_dev, ',');
   15.28  						if ( tmp ) {
    16.1 --- a/src/stdlib/SDL_getenv.c	Tue Feb 07 11:18:21 2006 +0000
    16.2 +++ b/src/stdlib/SDL_getenv.c	Tue Feb 07 12:11:33 2006 +0000
    16.3 @@ -113,11 +113,11 @@
    16.4  	}
    16.5  
    16.6  	/* Allocate memory for the variable */
    16.7 -	new_variable = (char *)malloc(strlen(variable)+1);
    16.8 +	new_variable = (char *)SDL_malloc(SDL_strlen(variable)+1);
    16.9  	if ( ! new_variable ) {
   16.10  		return(-1);
   16.11  	}
   16.12 -	strcpy(new_variable, variable);
   16.13 +	SDL_strcpy(new_variable, variable);
   16.14  
   16.15  	/* Actually put it into the environment */
   16.16  	added = 0;
   16.17 @@ -126,13 +126,13 @@
   16.18  		/* Check to see if it's already there... */
   16.19  		len = (value - name);
   16.20  		for ( ; SDL_env[i]; ++i ) {
   16.21 -			if ( strncmp(SDL_env[i], name, len) == 0 ) {
   16.22 +			if ( SDL_strncmp(SDL_env[i], name, len) == 0 ) {
   16.23  				break;
   16.24  			}
   16.25  		}
   16.26  		/* If we found it, just replace the entry */
   16.27  		if ( SDL_env[i] ) {
   16.28 -			free(SDL_env[i]);
   16.29 +			SDL_free(SDL_env[i]);
   16.30  			SDL_env[i] = new_variable;
   16.31  			added = 1;
   16.32  		}
   16.33 @@ -147,7 +147,7 @@
   16.34  			SDL_env[i++] = (char *)0;
   16.35  			added = 1;
   16.36  		} else {
   16.37 -			free(new_variable);
   16.38 +			SDL_free(new_variable);
   16.39  		}
   16.40  	}
   16.41  	return (added ? 0 : -1);
   16.42 @@ -161,9 +161,9 @@
   16.43  
   16.44  	value = (char *)0;
   16.45  	if ( SDL_env ) {
   16.46 -		len = strlen(name);
   16.47 +		len = SDL_strlen(name);
   16.48  		for ( i=0; SDL_env[i] && !value; ++i ) {
   16.49 -			if ( (strncmp(SDL_env[i], name, len) == 0) &&
   16.50 +			if ( (SDL_strncmp(SDL_env[i], name, len) == 0) &&
   16.51  			     (SDL_env[i][len] == '=') ) {
   16.52  				value = &SDL_env[i][len+1];
   16.53  			}
   16.54 @@ -185,59 +185,59 @@
   16.55  
   16.56  	printf("Checking for non-existent variable... ");
   16.57  	fflush(stdout);
   16.58 -	if ( ! getenv("EXISTS") ) {
   16.59 +	if ( ! SDL_getenv("EXISTS") ) {
   16.60  		printf("okay\n");
   16.61  	} else {
   16.62  		printf("failed\n");
   16.63  	}
   16.64  	printf("Setting FIRST=VALUE1 in the environment... ");
   16.65  	fflush(stdout);
   16.66 -	if ( putenv("FIRST=VALUE1") == 0 ) {
   16.67 +	if ( SDL_putenv("FIRST=VALUE1") == 0 ) {
   16.68  		printf("okay\n");
   16.69  	} else {
   16.70  		printf("failed\n");
   16.71  	}
   16.72  	printf("Getting FIRST from the environment... ");
   16.73  	fflush(stdout);
   16.74 -	value = getenv("FIRST");
   16.75 -	if ( value && (strcmp(value, "VALUE1") == 0) ) {
   16.76 +	value = SDL_getenv("FIRST");
   16.77 +	if ( value && (SDL_strcmp(value, "VALUE1") == 0) ) {
   16.78  		printf("okay\n");
   16.79  	} else {
   16.80  		printf("failed\n");
   16.81  	}
   16.82  	printf("Setting SECOND=VALUE2 in the environment... ");
   16.83  	fflush(stdout);
   16.84 -	if ( putenv("SECOND=VALUE2") == 0 ) {
   16.85 +	if ( SDL_putenv("SECOND=VALUE2") == 0 ) {
   16.86  		printf("okay\n");
   16.87  	} else {
   16.88  		printf("failed\n");
   16.89  	}
   16.90  	printf("Getting SECOND from the environment... ");
   16.91  	fflush(stdout);
   16.92 -	value = getenv("SECOND");
   16.93 -	if ( value && (strcmp(value, "VALUE2") == 0) ) {
   16.94 +	value = SDL_getenv("SECOND");
   16.95 +	if ( value && (SDL_strcmp(value, "VALUE2") == 0) ) {
   16.96  		printf("okay\n");
   16.97  	} else {
   16.98  		printf("failed\n");
   16.99  	}
  16.100  	printf("Setting FIRST=NOVALUE in the environment... ");
  16.101  	fflush(stdout);
  16.102 -	if ( putenv("FIRST=NOVALUE") == 0 ) {
  16.103 +	if ( SDL_putenv("FIRST=NOVALUE") == 0 ) {
  16.104  		printf("okay\n");
  16.105  	} else {
  16.106  		printf("failed\n");
  16.107  	}
  16.108  	printf("Getting FIRST from the environment... ");
  16.109  	fflush(stdout);
  16.110 -	value = getenv("FIRST");
  16.111 -	if ( value && (strcmp(value, "NOVALUE") == 0) ) {
  16.112 +	value = SDL_getenv("FIRST");
  16.113 +	if ( value && (SDL_strcmp(value, "NOVALUE") == 0) ) {
  16.114  		printf("okay\n");
  16.115  	} else {
  16.116  		printf("failed\n");
  16.117  	}
  16.118  	printf("Checking for non-existent variable... ");
  16.119  	fflush(stdout);
  16.120 -	if ( ! getenv("EXISTS") ) {
  16.121 +	if ( ! SDL_getenv("EXISTS") ) {
  16.122  		printf("okay\n");
  16.123  	} else {
  16.124  		printf("failed\n");
    17.1 --- a/src/stdlib/SDL_string.c	Tue Feb 07 11:18:21 2006 +0000
    17.2 +++ b/src/stdlib/SDL_string.c	Tue Feb 07 12:11:33 2006 +0000
    17.3 @@ -25,6 +25,7 @@
    17.4  
    17.5  #include "SDL_types.h"
    17.6  #include "SDL_ctype.h"
    17.7 +#include "SDL_stdlib.h"
    17.8  #include "SDL_string.h"
    17.9  
   17.10  
   17.11 @@ -175,7 +176,7 @@
   17.12  #endif
   17.13  #endif /* SDL_HAS_64BIT_TYPE */
   17.14  
   17.15 -#ifndef HAVE_SSCANF
   17.16 +#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD)
   17.17  static size_t SDL_ScanFloat(const char *text, double *valuep)
   17.18  {
   17.19      const char *textstart = text;
   17.20 @@ -322,6 +323,18 @@
   17.21  }
   17.22  #endif
   17.23  
   17.24 +#ifndef HAVE_STRDUP
   17.25 +char *SDL_strdup(const char *string)
   17.26 +{
   17.27 +    size_t len = SDL_strlen(string);
   17.28 +    char *newstr = SDL_malloc(len+1);
   17.29 +    if ( newstr ) {
   17.30 +        SDL_strcpy(newstr, string);
   17.31 +    }
   17.32 +    return newstr;
   17.33 +}
   17.34 +#endif
   17.35 +
   17.36  #ifndef HAVE__STRREV
   17.37  char *SDL_strrev(char *string)
   17.38  {
   17.39 @@ -549,6 +562,20 @@
   17.40  
   17.41  #endif /* SDL_HAS_64BIT_TYPE */
   17.42  
   17.43 +#ifndef HAVE_STRTOD
   17.44 +double SDL_strtod(const char *string, char **endp)
   17.45 +{
   17.46 +    size_t len;
   17.47 +    double value;
   17.48 +
   17.49 +    len = SDL_ScanFloat(string, &value);
   17.50 +    if ( endp ) {
   17.51 +        *endp = (char *)string + len;
   17.52 +    }
   17.53 +    return value;
   17.54 +}
   17.55 +#endif
   17.56 +
   17.57  #ifndef HAVE_STRCMP
   17.58  int SDL_strcmp(const char *str1, const char *str2)
   17.59  {
    18.1 --- a/src/video/SDL_video.c	Tue Feb 07 11:18:21 2006 +0000
    18.2 +++ b/src/video/SDL_video.c	Tue Feb 07 12:11:33 2006 +0000
    18.3 @@ -798,7 +798,7 @@
    18.4  		 */
    18.5  		if ( (bpp == 16) &&
    18.6  		     (SDL_strstr((const char *)video->glGetString(GL_EXTENSIONS), "GL_EXT_packed_pixels") ||
    18.7 -		     (atof((const char *)video->glGetString(GL_VERSION)) >= 1.2f))
    18.8 +		     (SDL_atof((const char *)video->glGetString(GL_VERSION)) >= 1.2f))
    18.9  		   ) {
   18.10  			video->is_32bit = 0;
   18.11  			SDL_VideoSurface = SDL_CreateRGBSurface(
    19.1 --- a/src/video/SDL_yuv.c	Tue Feb 07 11:18:21 2006 +0000
    19.2 +++ b/src/video/SDL_yuv.c	Tue Feb 07 12:11:33 2006 +0000
    19.3 @@ -23,6 +23,7 @@
    19.4  /* This is the implementation of the YUV video surface support */
    19.5  
    19.6  #include "SDL_stdlib.h"
    19.7 +#include "SDL_string.h"
    19.8  #include "SDL_video.h"
    19.9  #include "SDL_error.h"
   19.10  #include "SDL_sysvideo.h"
   19.11 @@ -54,7 +55,7 @@
   19.12  	overlay = NULL;
   19.13          yuv_hwaccel = SDL_getenv("SDL_VIDEO_YUV_HWACCEL");
   19.14  	if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) &&
   19.15 -	     (!yuv_hwaccel || (*yuv_hwaccel != '0')) ) {
   19.16 +	     (!yuv_hwaccel || (SDL_atoi(yuv_hwaccel) > 0)) ) {
   19.17  		overlay = video->CreateYUVOverlay(this, w, h, format, display);
   19.18  	}
   19.19  	/* If hardware YUV overlay failed ... */
    20.1 --- a/src/video/fbcon/SDL_fbelo.c	Tue Feb 07 11:18:21 2006 +0000
    20.2 +++ b/src/video/fbcon/SDL_fbelo.c	Tue Feb 07 12:11:33 2006 +0000
    20.3 @@ -92,7 +92,7 @@
    20.4  	x = ((mousebuf[4] << 8) | mousebuf[3]);
    20.5  	y = ((mousebuf[6] << 8) | mousebuf[5]);
    20.6  
    20.7 -	if((abs(x - last_x) > ELO_SNAP_SIZE) || (abs(y - last_y) > ELO_SNAP_SIZE)) {
    20.8 +	if((SDL_abs(x - last_x) > ELO_SNAP_SIZE) || (SDL_abs(y - last_y) > ELO_SNAP_SIZE)) {
    20.9  		*dx = ((mousebuf[4] << 8) | mousebuf[3]);
   20.10  		*dy = ((mousebuf[6] << 8) | mousebuf[5]);
   20.11  	}
   20.12 @@ -335,19 +335,19 @@
   20.13  	/* try to read the calibration values */
   20.14  	buffer = SDL_getenv("SDL_ELO_MIN_X");
   20.15  	if(buffer) {
   20.16 -		ELO_MIN_X = atoi(buffer);
   20.17 +		ELO_MIN_X = SDL_atoi(buffer);
   20.18  	}
   20.19  	buffer = SDL_getenv("SDL_ELO_MAX_X");
   20.20  	if(buffer) {
   20.21 -		ELO_MAX_X = atoi(buffer);
   20.22 +		ELO_MAX_X = SDL_atoi(buffer);
   20.23  	}
   20.24  	buffer = SDL_getenv("SDL_ELO_MIN_Y");
   20.25  	if(buffer) {
   20.26 -		ELO_MIN_Y = atoi(buffer);
   20.27 +		ELO_MIN_Y = SDL_atoi(buffer);
   20.28  	}
   20.29  	buffer = SDL_getenv("SDL_ELO_MAX_Y");
   20.30  	if(buffer) {
   20.31 -		ELO_MAX_Y = atoi(buffer);
   20.32 +		ELO_MAX_Y = SDL_atoi(buffer);
   20.33  	}
   20.34  
   20.35  #ifdef DEBUG_MOUSE
    21.1 --- a/src/video/fbcon/SDL_fbevents.c	Tue Feb 07 11:18:21 2006 +0000
    21.2 +++ b/src/video/fbcon/SDL_fbevents.c	Tue Feb 07 12:11:33 2006 +0000
    21.3 @@ -351,7 +351,7 @@
    21.4  				name[0] = '\0';
    21.5  				fscanf(status, "Name: %s", name);
    21.6  				if ( SDL_strcmp(name, wanted_name) == 0 ) {
    21.7 -					pid = atoi(entry->d_name);
    21.8 +					pid = SDL_atoi(entry->d_name);
    21.9  				}
   21.10  				fclose(status);
   21.11  			}
    22.1 --- a/src/video/fbcon/SDL_fbvideo.c	Tue Feb 07 11:18:21 2006 +0000
    22.2 +++ b/src/video/fbcon/SDL_fbvideo.c	Tue Feb 07 12:11:33 2006 +0000
    22.3 @@ -523,7 +523,7 @@
    22.4  	{ const char *fb_accel;
    22.5  		fb_accel = SDL_getenv("SDL_FBACCEL");
    22.6  		if ( fb_accel ) {
    22.7 -			finfo.accel = atoi(fb_accel);
    22.8 +			finfo.accel = SDL_atoi(fb_accel);
    22.9  		}
   22.10  	}
   22.11  
    23.1 --- a/src/video/nanox/SDL_nxvideo.c	Tue Feb 07 11:18:21 2006 +0000
    23.2 +++ b/src/video/nanox/SDL_nxvideo.c	Tue Feb 07 12:11:33 2006 +0000
    23.3 @@ -68,9 +68,9 @@
    23.4      Dprintf ("enter NX_DeleteDevice\n") ;
    23.5  
    23.6      if (device) {
    23.7 -        if (device -> hidden) free (device -> hidden) ;
    23.8 -        if (device -> gl_data) free (device -> gl_data) ;
    23.9 -            free (device) ;
   23.10 +        if (device -> hidden) SDL_free (device -> hidden) ;
   23.11 +        if (device -> gl_data) SDL_free (device -> gl_data) ;
   23.12 +            SDL_free (device) ;
   23.13      }
   23.14  
   23.15      Dprintf ("leave NX_DeleteDevice\n") ;
   23.16 @@ -256,9 +256,9 @@
   23.17          GrDestroyWindow (FSwindow) ;
   23.18      }
   23.19      NX_FreeVideoModes (this) ;
   23.20 -    free (GammaRamp_R) ;
   23.21 -    free (GammaRamp_G) ;
   23.22 -    free (GammaRamp_B) ;
   23.23 +    SDL_free (GammaRamp_R) ;
   23.24 +    SDL_free (GammaRamp_G) ;
   23.25 +    SDL_free (GammaRamp_B) ;
   23.26  
   23.27  #ifdef ENABLE_NANOX_DIRECT_FB
   23.28      if (Clientfb)
   23.29 @@ -306,7 +306,7 @@
   23.30  
   23.31      // See if we have been given a window id
   23.32      if (SDL_windowid) {
   23.33 -        SDL_Window = strtol (SDL_windowid, NULL, 0) ;
   23.34 +        SDL_Window = SDL_strtol (SDL_windowid, NULL, 0) ;
   23.35      } else {
   23.36          SDL_Window = 0 ;
   23.37      }
    24.1 --- a/src/video/wincommon/SDL_sysevents.c	Tue Feb 07 11:18:21 2006 +0000
    24.2 +++ b/src/video/wincommon/SDL_sysevents.c	Tue Feb 07 12:11:33 2006 +0000
    24.3 @@ -798,7 +798,7 @@
    24.4  	int	cp = GetACP();
    24.5  
    24.6  	if (GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, buff, sizeof(buff))) {
    24.7 -		cp = SDL_strtol(buff, NULL, 0);
    24.8 +		cp = SDL_atoi(buff);
    24.9  	}
   24.10  	return cp;
   24.11  }