Whoops, need this. :)
authorSam Lantinga <slouken@libsdl.org>
Fri, 10 Feb 2006 03:21:39 +0000
changeset 1357e18467d67cfd
parent 1356 67114343400d
child 1358 c71e05b4dc2e
Whoops, need this. :)
include/SDL_stdinc.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_stdinc.h	Fri Feb 10 03:21:39 2006 +0000
     1.3 @@ -0,0 +1,540 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2006 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +
    1.26 +/* This is a general header that includes C language support */
    1.27 +
    1.28 +#ifndef _SDL_stdinc_h
    1.29 +#define _SDL_stdinc_h
    1.30 +
    1.31 +#include "SDL_config.h"
    1.32 +
    1.33 +/* AIX requires this to be the first thing in the file.  */
    1.34 +#ifndef __GNUC__
    1.35 +# if HAVE_ALLOCA_H
    1.36 +#  include <alloca.h>
    1.37 +# else
    1.38 +#  ifdef _AIX
    1.39 + #pragma alloca
    1.40 +#  else
    1.41 +#   ifndef alloca /* predefined by HP cc +Olibcalls */
    1.42 +char *alloca ();
    1.43 +#   endif
    1.44 +#  endif
    1.45 +# endif
    1.46 +#endif
    1.47 +
    1.48 +#if HAVE_SYS_TYPES_H
    1.49 +#include <sys/types.h>
    1.50 +#endif
    1.51 +#if HAVE_STDIO_H
    1.52 +#include <stdio.h>
    1.53 +#endif
    1.54 +#if STDC_HEADERS
    1.55 +# include <stdlib.h>
    1.56 +# include <stddef.h>
    1.57 +# include <stdarg.h>
    1.58 +#else
    1.59 +# if HAVE_STDLIB_H
    1.60 +# include <stdlib.h>
    1.61 +# endif
    1.62 +# if HAVE_STDARG_H
    1.63 +# include <stdarg.h>
    1.64 +# endif
    1.65 +#endif
    1.66 +#if HAVE_MALLOC_H
    1.67 +# include <malloc.h>
    1.68 +#endif
    1.69 +#if HAVE_STRING_H
    1.70 +# if !STDC_HEADERS && HAVE_MEMORY_H
    1.71 +# include <memory.h>
    1.72 +# endif
    1.73 +# include <string.h>
    1.74 +#endif
    1.75 +#if HAVE_STRINGS_H
    1.76 +# include <strings.h>
    1.77 +#endif
    1.78 +#if HAVE_INTTYPES_H
    1.79 +# include <inttypes.h>
    1.80 +#else
    1.81 +# if HAVE_STDINT_H
    1.82 +# include <stdint.h>
    1.83 +# endif
    1.84 +#endif
    1.85 +#if HAVE_CTYPE_H
    1.86 +# include <ctype.h>
    1.87 +#endif
    1.88 +
    1.89 +/* The number of elements in an array */
    1.90 +#define SDL_arraysize(array)	(sizeof(array)/sizeof(array[0]))
    1.91 +#define SDL_TABLESIZE(table)	SDL_arraysize(table)
    1.92 +
    1.93 +/* Basic data types */
    1.94 +typedef enum SDL_bool {
    1.95 +	SDL_FALSE = 0,
    1.96 +	SDL_TRUE  = 1
    1.97 +} SDL_bool;
    1.98 +
    1.99 +typedef int8_t		Sint8;
   1.100 +typedef uint8_t		Uint8;
   1.101 +typedef int16_t		Sint16;
   1.102 +typedef uint16_t	Uint16;
   1.103 +typedef int32_t		Sint32;
   1.104 +typedef uint32_t	Uint32;
   1.105 +
   1.106 +#ifdef SDL_HAS_64BIT_TYPE
   1.107 +typedef int64_t		Sint64;
   1.108 +typedef uint64_t	Uint64;
   1.109 +#else
   1.110 +/* This is really just a hack to prevent the compiler from complaining */
   1.111 +typedef struct {
   1.112 +	Uint32 hi;
   1.113 +	Uint32 lo;
   1.114 +} Uint64, Sint64;
   1.115 +#endif
   1.116 +
   1.117 +/* Make sure the types really have the right sizes */
   1.118 +#define SDL_COMPILE_TIME_ASSERT(name, x)               \
   1.119 +       typedef int SDL_dummy_ ## name[(x) * 2 - 1]
   1.120 +
   1.121 +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
   1.122 +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
   1.123 +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
   1.124 +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
   1.125 +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
   1.126 +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
   1.127 +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
   1.128 +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
   1.129 +
   1.130 +/* Check to make sure enums are the size of ints, for structure packing.
   1.131 +   For both Watcom C/C++ and Borland C/C++ the compiler option that makes
   1.132 +   enums having the size of an int must be enabled.
   1.133 +   This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
   1.134 +*/
   1.135 +/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
   1.136 +#ifdef __MWERKS__
   1.137 +#pragma enumsalwaysint on
   1.138 +#endif
   1.139 +
   1.140 +typedef enum {
   1.141 +	DUMMY_ENUM_VALUE
   1.142 +} SDL_DUMMY_ENUM;
   1.143 +
   1.144 +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
   1.145 +
   1.146 +
   1.147 +#include "begin_code.h"
   1.148 +/* Set up for C function definitions, even when using C++ */
   1.149 +#ifdef __cplusplus
   1.150 +extern "C" {
   1.151 +#endif
   1.152 +
   1.153 +#if HAVE_MALLOC
   1.154 +#define SDL_malloc	malloc
   1.155 +#else
   1.156 +extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
   1.157 +#endif
   1.158 +
   1.159 +#if HAVE_CALLOC
   1.160 +#define SDL_calloc	calloc
   1.161 +#else
   1.162 +extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
   1.163 +#endif
   1.164 +
   1.165 +#if HAVE_REALLOC
   1.166 +#define SDL_realloc	realloc
   1.167 +#else
   1.168 +extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
   1.169 +#endif
   1.170 +
   1.171 +#if HAVE_FREE
   1.172 +#define SDL_free	free
   1.173 +#else
   1.174 +extern DECLSPEC void SDLCALL SDL_free(void *mem);
   1.175 +#endif
   1.176 +
   1.177 +#if HAVE_ALLOCA
   1.178 +#define SDL_stack_alloc(type, count)    (type*)alloca(sizeof(type)*count)
   1.179 +#define SDL_stack_free(data)
   1.180 +#else
   1.181 +#define SDL_stack_alloc(type, count)    (type*)SDL_malloc(sizeof(type)*count)
   1.182 +#define SDL_stack_free(data)            SDL_free(data)
   1.183 +#endif
   1.184 +
   1.185 +#if HAVE_GETENV
   1.186 +#define SDL_getenv	getenv
   1.187 +#else
   1.188 +extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
   1.189 +#endif
   1.190 +
   1.191 +#if HAVE_PUTENV
   1.192 +#define SDL_putenv	putenv
   1.193 +#else
   1.194 +extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
   1.195 +#endif
   1.196 +
   1.197 +#if HAVE_QSORT
   1.198 +#define SDL_qsort	qsort
   1.199 +#else
   1.200 +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
   1.201 +           int (*compare)(const void *, const void *));
   1.202 +#endif
   1.203 +
   1.204 +#if HAVE_ABS
   1.205 +#define SDL_abs		abs
   1.206 +#else
   1.207 +#define SDL_abs(X)	((X) < 0 ? -(X) : (X))
   1.208 +#endif
   1.209 +
   1.210 +#if HAVE_CTYPE_H
   1.211 +#define SDL_isdigit(X)  isdigit(X)
   1.212 +#define SDL_isspace(X)  isspace(X)
   1.213 +#define SDL_toupper(X)  toupper(X)
   1.214 +#define SDL_tolower(X)  tolower(X)
   1.215 +#else
   1.216 +#define SDL_isdigit(X)  (((X) >= '0') && ((X) <= '9'))
   1.217 +#define SDL_isspace(X)  (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
   1.218 +#define SDL_toupper(X)  (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
   1.219 +#define SDL_tolower(X)  (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
   1.220 +#endif
   1.221 +
   1.222 +#if HAVE_MEMSET
   1.223 +#define SDL_memset      memset
   1.224 +#else
   1.225 +extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
   1.226 +#endif
   1.227 +
   1.228 +#if defined(__GNUC__) && defined(i386)
   1.229 +#define SDL_memset4(dst, val, len)				\
   1.230 +do {								\
   1.231 +	int u0, u1, u2;						\
   1.232 +	__asm__ __volatile__ (					\
   1.233 +		"cld\n\t"					\
   1.234 +		"rep ; stosl\n\t"				\
   1.235 +		: "=&D" (u0), "=&a" (u1), "=&c" (u2)		\
   1.236 +		: "0" (dst), "1" (val), "2" ((Uint32)(len))	\
   1.237 +		: "memory" );					\
   1.238 +} while(0)
   1.239 +#endif
   1.240 +#ifndef SDL_memset4
   1.241 +#define SDL_memset4(dst, val, len)		\
   1.242 +do {						\
   1.243 +	unsigned _count = (len);		\
   1.244 +	unsigned _n = (_count + 3) / 4;		\
   1.245 +	Uint32 *_p = (Uint32 *)(dst);		\
   1.246 +	Uint32 _val = (val);			\
   1.247 +        switch (_count % 4) {			\
   1.248 +        case 0: do {    *_p++ = _val;		\
   1.249 +        case 3:         *_p++ = _val;		\
   1.250 +        case 2:         *_p++ = _val;		\
   1.251 +        case 1:         *_p++ = _val;		\
   1.252 +		} while ( --_n );		\
   1.253 +	}					\
   1.254 +} while(0)
   1.255 +#endif
   1.256 +
   1.257 +#if defined(__GNUC__) && defined(i386)
   1.258 +#define SDL_memcpy(dst, src, len)					  \
   1.259 +do {									  \
   1.260 +	int u0, u1, u2;						  	  \
   1.261 +	__asm__ __volatile__ (						  \
   1.262 +		"cld\n\t"						  \
   1.263 +		"rep ; movsl\n\t"					  \
   1.264 +		"testb $2,%b4\n\t"					  \
   1.265 +		"je 1f\n\t"						  \
   1.266 +		"movsw\n"						  \
   1.267 +		"1:\ttestb $1,%b4\n\t"					  \
   1.268 +		"je 2f\n\t"						  \
   1.269 +		"movsb\n"						  \
   1.270 +		"2:"							  \
   1.271 +		: "=&c" (u0), "=&D" (u1), "=&S" (u2)			  \
   1.272 +		: "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \
   1.273 +		: "memory" );						  \
   1.274 +} while(0)
   1.275 +#endif
   1.276 +#ifndef SDL_memcpy
   1.277 +#if HAVE_MEMCPY
   1.278 +#define SDL_memcpy      memcpy
   1.279 +#elif HAVE_BCOPY
   1.280 +#define SDL_memcpy(d, s, n)	bcopy((s), (d), (n))
   1.281 +#else
   1.282 +extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
   1.283 +#endif
   1.284 +#endif
   1.285 +
   1.286 +#if defined(__GNUC__) && defined(i386)
   1.287 +#define SDL_memcpy4(dst, src, len)				\
   1.288 +do {								\
   1.289 +	int ecx, edi, esi;					\
   1.290 +	__asm__ __volatile__ (					\
   1.291 +		"cld\n\t"					\
   1.292 +		"rep ; movsl"					\
   1.293 +		: "=&c" (ecx), "=&D" (edi), "=&S" (esi)		\
   1.294 +		: "0" ((unsigned)(len)), "1" (dst), "2" (src)	\
   1.295 +		: "memory" );					\
   1.296 +} while(0)
   1.297 +#endif
   1.298 +#ifndef SDL_memcpy4
   1.299 +#define SDL_memcpy4(dst, src, len)	SDL_memcpy(dst, src, (len) << 2)
   1.300 +#endif
   1.301 +
   1.302 +#if defined(__GNUC__) && defined(i386)
   1.303 +#define SDL_revcpy(dst, src, len)			\
   1.304 +do {							\
   1.305 +	int u0, u1, u2;					\
   1.306 +	char *dstp = (char *)(dst);			\
   1.307 +	char *srcp = (char *)(src);			\
   1.308 +	int n = (len);					\
   1.309 +	if ( n >= 4 ) {					\
   1.310 +	__asm__ __volatile__ (				\
   1.311 +		"std\n\t"				\
   1.312 +		"rep ; movsl\n\t"			\
   1.313 +		: "=&c" (u0), "=&D" (u1), "=&S" (u2)	\
   1.314 +		: "0" (n >> 2),				\
   1.315 +		  "1" (dstp+(n-4)), "2" (srcp+(n-4))	\
   1.316 +		: "memory" );				\
   1.317 +	}						\
   1.318 +	switch (n & 3) {				\
   1.319 +		case 3: dstp[2] = srcp[2];		\
   1.320 +		case 2: dstp[1] = srcp[1];		\
   1.321 +		case 1: dstp[0] = srcp[0];		\
   1.322 +			break;				\
   1.323 +		default:				\
   1.324 +			break;				\
   1.325 +	}						\
   1.326 +} while(0)
   1.327 +#endif
   1.328 +#ifndef SDL_revcpy
   1.329 +extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
   1.330 +#endif
   1.331 +
   1.332 +#if HAVE_MEMMOVE
   1.333 +#define SDL_memmove     memmove
   1.334 +#elif HAVE_BCOPY
   1.335 +#define SDL_memmove(d, s, n)	bcopy((s), (d), (n))
   1.336 +#else
   1.337 +#define SDL_memmove(dst, src, len)			\
   1.338 +do {							\
   1.339 +	if ( dst < src ) {				\
   1.340 +		SDL_memcpy(dst, src, len);		\
   1.341 +	} else {					\
   1.342 +		SDL_revcpy(dst, src, len);		\
   1.343 +	}						\
   1.344 +} while(0)
   1.345 +#endif
   1.346 +
   1.347 +#if HAVE_MEMCMP
   1.348 +#define SDL_memcmp      memcmp
   1.349 +#else
   1.350 +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
   1.351 +#endif
   1.352 +
   1.353 +#if HAVE_STRLEN
   1.354 +#define SDL_strlen      strlen
   1.355 +#else
   1.356 +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
   1.357 +#endif
   1.358 +
   1.359 +#if HAVE_STRCPY
   1.360 +#define SDL_strcpy     strcpy
   1.361 +#else
   1.362 +extern DECLSPEC char * SDLCALL SDL_strcpy(char *dst, const char *src);
   1.363 +#endif
   1.364 +
   1.365 +#if HAVE_STRNCPY
   1.366 +#define SDL_strncpy     strncpy
   1.367 +#else
   1.368 +extern DECLSPEC char * SDLCALL SDL_strncpy(char *dst, const char *src, size_t maxlen);
   1.369 +#endif
   1.370 +
   1.371 +#if HAVE_STRCAT
   1.372 +#define SDL_strcat     strcat
   1.373 +#else
   1.374 +#define SDL_strcat(dst, src)    (SDL_strcpy(dst+SDL_strlen(dst), src), dst)
   1.375 +#endif
   1.376 +
   1.377 +#if HAVE_STRNCAT
   1.378 +#define SDL_strncat    strncat
   1.379 +#else
   1.380 +#define SDL_strncat(dst, src, n) (SDL_strncpy(dst+SDL_strlen(dst), src, n), dst)
   1.381 +#endif
   1.382 +
   1.383 +#if HAVE_STRDUP
   1.384 +#define SDL_strdup     strdup
   1.385 +#else
   1.386 +extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
   1.387 +#endif
   1.388 +
   1.389 +#if HAVE__STRREV
   1.390 +#define SDL_strrev      _strrev
   1.391 +#else
   1.392 +extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
   1.393 +#endif
   1.394 +
   1.395 +#if HAVE__STRUPR
   1.396 +#define SDL_strupr      _strupr
   1.397 +#else
   1.398 +extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
   1.399 +#endif
   1.400 +
   1.401 +#if HAVE__STRLWR
   1.402 +#define SDL_strlwr      _strlwr
   1.403 +#else
   1.404 +extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
   1.405 +#endif
   1.406 +
   1.407 +#if HAVE_STRCHR
   1.408 +#define SDL_strchr      strchr
   1.409 +#elif HAVE_INDEX
   1.410 +#define SDL_strchr      index
   1.411 +#else
   1.412 +extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
   1.413 +#endif
   1.414 +
   1.415 +#if HAVE_STRRCHR
   1.416 +#define SDL_strrchr     strrchr
   1.417 +#elif HAVE_RINDEX
   1.418 +#define SDL_strrchr     rindex
   1.419 +#else
   1.420 +extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
   1.421 +#endif
   1.422 +
   1.423 +#if HAVE_STRSTR
   1.424 +#define SDL_strstr      strstr
   1.425 +#else
   1.426 +extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
   1.427 +#endif
   1.428 +
   1.429 +#if HAVE_ITOA
   1.430 +#define SDL_itoa        itoa
   1.431 +#else
   1.432 +#define SDL_itoa(value, string, radix)	SDL_ltoa((long)value, string, radix)
   1.433 +#endif
   1.434 +
   1.435 +#if HAVE__LTOA
   1.436 +#define SDL_ltoa        _ltoa
   1.437 +#else
   1.438 +extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
   1.439 +#endif
   1.440 +
   1.441 +#if HAVE__UITOA
   1.442 +#define SDL_uitoa       _uitoa
   1.443 +#else
   1.444 +#define SDL_uitoa(value, string, radix)	SDL_ultoa((long)value, string, radix)
   1.445 +#endif
   1.446 +
   1.447 +#if HAVE__ULTOA
   1.448 +#define SDL_ultoa       _ultoa
   1.449 +#else
   1.450 +extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
   1.451 +#endif
   1.452 +
   1.453 +#if HAVE_STRTOL
   1.454 +#define SDL_strtol      strtol
   1.455 +#else
   1.456 +extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
   1.457 +#endif
   1.458 +
   1.459 +#if SDL_HAS_64BIT_TYPE
   1.460 +
   1.461 +#if HAVE__I64TOA
   1.462 +#define SDL_lltoa       _i64toa
   1.463 +#else
   1.464 +extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
   1.465 +#endif
   1.466 +
   1.467 +#if HAVE__UI64TOA
   1.468 +#define SDL_ulltoa      _ui64toa
   1.469 +#else
   1.470 +extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
   1.471 +#endif
   1.472 +
   1.473 +#if HAVE_STRTOLL
   1.474 +#define SDL_strtoll     strtoll
   1.475 +#else
   1.476 +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
   1.477 +#endif
   1.478 +
   1.479 +#endif /* SDL_HAS_64BIT_TYPE */
   1.480 +
   1.481 +#if HAVE_STRTOD
   1.482 +#define SDL_strtod      strtod
   1.483 +#else
   1.484 +extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
   1.485 +#endif
   1.486 +
   1.487 +#if HAVE_ATOI
   1.488 +#define SDL_atoi        atoi
   1.489 +#else
   1.490 +#define SDL_atoi(X)     SDL_strtol(X, NULL, 0)
   1.491 +#endif
   1.492 +
   1.493 +#if HAVE_ATOF
   1.494 +#define SDL_atof        atof
   1.495 +#else
   1.496 +#define SDL_atof(X)     SDL_strtod(X, NULL)
   1.497 +#endif
   1.498 +
   1.499 +#if HAVE_STRCMP
   1.500 +#define SDL_strcmp      strcmp
   1.501 +#else
   1.502 +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
   1.503 +#endif
   1.504 +
   1.505 +#if HAVE_STRNCMP
   1.506 +#define SDL_strncmp     strncmp
   1.507 +#else
   1.508 +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
   1.509 +#endif
   1.510 +
   1.511 +#if HAVE_STRCASECMP
   1.512 +#define SDL_strcasecmp  strcasecmp
   1.513 +#elif HAVE_STRICMP
   1.514 +#define SDL_strcasecmp  stricmp
   1.515 +#else
   1.516 +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
   1.517 +#endif
   1.518 +
   1.519 +#if HAVE_SSCANF
   1.520 +#define SDL_sscanf      sscanf
   1.521 +#else
   1.522 +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
   1.523 +#endif
   1.524 +
   1.525 +#if HAVE_SNPRINTF
   1.526 +#define SDL_snprintf    snprintf
   1.527 +#else
   1.528 +extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
   1.529 +#endif
   1.530 +
   1.531 +#if HAVE_VSNPRINTF
   1.532 +#define SDL_vsnprintf   vsnprintf
   1.533 +#else
   1.534 +extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
   1.535 +#endif
   1.536 +
   1.537 +/* Ends C function definitions when using C++ */
   1.538 +#ifdef __cplusplus
   1.539 +}
   1.540 +#endif
   1.541 +#include "close_code.h"
   1.542 +
   1.543 +#endif /* _SDL_stdinc_h */