misc/winutils/include/SDL_stdinc.h
author sheepluva
Tue, 04 Feb 2014 15:23:37 +0100
changeset 10104 cb0b750bd8a3
parent 10017 de822cd3df3a
permissions -rw-r--r--
yo dawg, I herd you like PChar...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     1
/*
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     2
    SDL - Simple DirectMedia Layer
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
     3
    Copyright (C) 1997-2012 Sam Lantinga
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     4
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     5
    This library is free software; you can redistribute it and/or
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     6
    modify it under the terms of the GNU Lesser General Public
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     7
    License as published by the Free Software Foundation; either
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     8
    version 2.1 of the License, or (at your option) any later version.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     9
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    10
    This library is distributed in the hope that it will be useful,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    13
    Lesser General Public License for more details.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    14
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    15
    You should have received a copy of the GNU Lesser General Public
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    16
    License along with this library; if not, write to the Free Software
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    18
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    19
    Sam Lantinga
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    20
    slouken@libsdl.org
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    21
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    22
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    23
/** @file SDL_stdinc.h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    24
 *  This is a general header that includes C language support
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    25
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    26
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    27
#ifndef _SDL_stdinc_h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    28
#define _SDL_stdinc_h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    29
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    30
#include "SDL_config.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    31
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    32
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    33
#ifdef HAVE_SYS_TYPES_H
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    34
#include <sys/types.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    35
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    36
#ifdef HAVE_STDIO_H
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    37
#include <stdio.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    38
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    39
#if defined(STDC_HEADERS)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    40
# include <stdlib.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    41
# include <stddef.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    42
# include <stdarg.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    43
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    44
# if defined(HAVE_STDLIB_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    45
#  include <stdlib.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    46
# elif defined(HAVE_MALLOC_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    47
#  include <malloc.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    48
# endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    49
# if defined(HAVE_STDDEF_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    50
#  include <stddef.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    51
# endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    52
# if defined(HAVE_STDARG_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    53
#  include <stdarg.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    54
# endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    55
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    56
#ifdef HAVE_STRING_H
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    57
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    58
#  include <memory.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    59
# endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    60
# include <string.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    61
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    62
#ifdef HAVE_STRINGS_H
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    63
# include <strings.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    64
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    65
#if defined(HAVE_INTTYPES_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    66
# include <inttypes.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    67
#elif defined(HAVE_STDINT_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    68
# include <stdint.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    69
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    70
#ifdef HAVE_CTYPE_H
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    71
# include <ctype.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    72
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    73
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    74
# include <iconv.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    75
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    76
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    77
/** The number of elements in an array */
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    78
#define SDL_arraysize(array)    (sizeof(array)/sizeof(array[0]))
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    79
#define SDL_TABLESIZE(table)    SDL_arraysize(table)
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    80
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    81
/* Use proper C++ casts when compiled as C++ to be compatible with the option
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    82
 -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    83
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    84
#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    85
#define SDL_static_cast(type, expression) static_cast<type>(expression)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    86
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    87
#define SDL_reinterpret_cast(type, expression) ((type)(expression))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    88
#define SDL_static_cast(type, expression) ((type)(expression))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    89
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    90
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    91
/** @name Basic data types */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    92
/*@{*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    93
typedef enum {
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    94
    SDL_FALSE = 0,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    95
    SDL_TRUE  = 1
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    96
} SDL_bool;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    97
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    98
typedef int8_t      Sint8;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    99
typedef uint8_t     Uint8;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   100
typedef int16_t     Sint16;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   101
typedef uint16_t    Uint16;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   102
typedef int32_t     Sint32;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   103
typedef uint32_t    Uint32;
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   104
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   105
#ifdef SDL_HAS_64BIT_TYPE
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   106
typedef int64_t     Sint64;
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   107
#ifndef SYMBIAN32_GCCE
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   108
typedef uint64_t    Uint64;
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   109
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   110
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   111
/* This is really just a hack to prevent the compiler from complaining */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   112
typedef struct {
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   113
    Uint32 hi;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   114
    Uint32 lo;
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   115
} Uint64, Sint64;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   116
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   117
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   118
/*@}*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   119
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   120
/** @name Make sure the types really have the right sizes */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   121
/*@{*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   122
#define SDL_COMPILE_TIME_ASSERT(name, x)               \
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   123
       typedef int SDL_dummy_ ## name[(x) * 2 - 1]
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   124
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   125
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   126
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   127
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   128
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   129
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   130
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   131
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   132
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   133
/*@}*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   134
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   135
/** @name Enum Size Check
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   136
 *  Check to make sure enums are the size of ints, for structure packing.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   137
 *  For both Watcom C/C++ and Borland C/C++ the compiler option that makes
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   138
 *  enums having the size of an int must be enabled.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   139
 *  This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   140
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   141
/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   142
#ifdef __MWERKS__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   143
#pragma enumsalwaysint on
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   144
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   145
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   146
typedef enum {
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   147
    DUMMY_ENUM_VALUE
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   148
} SDL_DUMMY_ENUM;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   149
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   150
#ifndef __NDS__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   151
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   152
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   153
/*@}*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   154
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   155
#include "begin_code.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   156
/* Set up for C function definitions, even when using C++ */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   157
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   158
extern "C" {
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   159
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   160
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   161
#ifdef HAVE_MALLOC
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   162
#define SDL_malloc  malloc
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   163
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   164
extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   165
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   166
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   167
#ifdef HAVE_CALLOC
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   168
#define SDL_calloc  calloc
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   169
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   170
extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   171
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   172
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   173
#ifdef HAVE_REALLOC
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   174
#define SDL_realloc realloc
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   175
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   176
extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   177
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   178
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   179
#ifdef HAVE_FREE
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   180
#define SDL_free    free
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   181
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   182
extern DECLSPEC void SDLCALL SDL_free(void *mem);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   183
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   184
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   185
#if defined(HAVE_ALLOCA) && !defined(alloca)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   186
# if defined(HAVE_ALLOCA_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   187
#  include <alloca.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   188
# elif defined(__GNUC__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   189
#  define alloca __builtin_alloca
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   190
# elif defined(_MSC_VER)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   191
#  include <malloc.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   192
#  define alloca _alloca
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   193
# elif defined(__WATCOMC__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   194
#  include <malloc.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   195
# elif defined(__BORLANDC__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   196
#  include <malloc.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   197
# elif defined(__DMC__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   198
#  include <stdlib.h>
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   199
# elif defined(__AIX__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   200
  #pragma alloca
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   201
# elif defined(__MRC__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   202
   void *alloca (unsigned);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   203
# else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   204
   char *alloca ();
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   205
# endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   206
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   207
#ifdef HAVE_ALLOCA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   208
#define SDL_stack_alloc(type, count)    (type*)alloca(sizeof(type)*(count))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   209
#define SDL_stack_free(data)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   210
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   211
#define SDL_stack_alloc(type, count)    (type*)SDL_malloc(sizeof(type)*(count))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   212
#define SDL_stack_free(data)            SDL_free(data)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   213
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   214
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   215
#ifdef HAVE_GETENV
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   216
#define SDL_getenv  getenv
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   217
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   218
extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   219
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   220
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   221
#ifdef HAVE_PUTENV
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   222
#define SDL_putenv  putenv
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   223
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   224
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   225
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   226
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   227
#ifdef HAVE_QSORT
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   228
#define SDL_qsort   qsort
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   229
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   230
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   231
           int (*compare)(const void *, const void *));
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   232
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   233
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   234
#ifdef HAVE_ABS
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   235
#define SDL_abs     abs
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   236
#else
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   237
#define SDL_abs(X)  ((X) < 0 ? -(X) : (X))
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   238
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   239
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   240
#define SDL_min(x, y)   (((x) < (y)) ? (x) : (y))
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   241
#define SDL_max(x, y)   (((x) > (y)) ? (x) : (y))
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   242
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   243
#ifdef HAVE_CTYPE_H
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   244
#define SDL_isdigit(X)  isdigit(X)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   245
#define SDL_isspace(X)  isspace(X)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   246
#define SDL_toupper(X)  toupper(X)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   247
#define SDL_tolower(X)  tolower(X)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   248
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   249
#define SDL_isdigit(X)  (((X) >= '0') && ((X) <= '9'))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   250
#define SDL_isspace(X)  (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   251
#define SDL_toupper(X)  (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   252
#define SDL_tolower(X)  (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   253
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   254
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   255
#ifdef HAVE_MEMSET
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   256
#define SDL_memset      memset
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   257
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   258
extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   259
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   260
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   261
#if defined(__GNUC__) && defined(i386)
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   262
#define SDL_memset4(dst, val, len)              \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   263
do {                                \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   264
    int u0, u1, u2;                     \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   265
    __asm__ __volatile__ (                  \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   266
        "cld\n\t"                   \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   267
        "rep ; stosl\n\t"               \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   268
        : "=&D" (u0), "=&a" (u1), "=&c" (u2)        \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   269
        : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len))  \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   270
        : "memory" );                   \
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   271
} while(0)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   272
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   273
#ifndef SDL_memset4
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   274
#define SDL_memset4(dst, val, len)      \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   275
do {                        \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   276
    unsigned _count = (len);        \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   277
    unsigned _n = (_count + 3) / 4;     \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   278
    Uint32 *_p = SDL_static_cast(Uint32 *, dst);    \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   279
    Uint32 _val = (val);            \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   280
    if (len == 0) break;            \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   281
        switch (_count % 4) {           \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   282
        case 0: do {    *_p++ = _val;       \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   283
        case 3:         *_p++ = _val;       \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   284
        case 2:         *_p++ = _val;       \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   285
        case 1:         *_p++ = _val;       \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   286
        } while ( --_n );       \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   287
    }                   \
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   288
} while(0)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   289
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   290
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   291
/* We can count on memcpy existing on Mac OS X and being well-tuned. */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   292
#if defined(__MACH__) && defined(__APPLE__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   293
#define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   294
#elif defined(__GNUC__) && defined(i386)
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   295
#define SDL_memcpy(dst, src, len)                     \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   296
do {                                      \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   297
    int u0, u1, u2;                           \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   298
    __asm__ __volatile__ (                        \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   299
        "cld\n\t"                         \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   300
        "rep ; movsl\n\t"                     \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   301
        "testb $2,%b4\n\t"                    \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   302
        "je 1f\n\t"                       \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   303
        "movsw\n"                         \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   304
        "1:\ttestb $1,%b4\n\t"                    \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   305
        "je 2f\n\t"                       \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   306
        "movsb\n"                         \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   307
        "2:"                              \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   308
        : "=&c" (u0), "=&D" (u1), "=&S" (u2)              \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   309
        : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   310
        : "memory" );                         \
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   311
} while(0)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   312
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   313
#ifndef SDL_memcpy
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   314
#ifdef HAVE_MEMCPY
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   315
#define SDL_memcpy      memcpy
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   316
#elif defined(HAVE_BCOPY)
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   317
#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   318
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   319
extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   320
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   321
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   322
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   323
/* We can count on memcpy existing on Mac OS X and being well-tuned. */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   324
#if defined(__MACH__) && defined(__APPLE__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   325
#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   326
#elif defined(__GNUC__) && defined(i386)
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   327
#define SDL_memcpy4(dst, src, len)              \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   328
do {                                \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   329
    int ecx, edi, esi;                  \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   330
    __asm__ __volatile__ (                  \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   331
        "cld\n\t"                   \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   332
        "rep ; movsl"                   \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   333
        : "=&c" (ecx), "=&D" (edi), "=&S" (esi)     \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   334
        : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src)    \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   335
        : "memory" );                   \
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   336
} while(0)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   337
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   338
#ifndef SDL_memcpy4
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   339
#define SDL_memcpy4(dst, src, len)  SDL_memcpy(dst, src, (len) << 2)
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   340
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   341
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   342
#if defined(__GNUC__) && defined(i386)
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   343
#define SDL_revcpy(dst, src, len)           \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   344
do {                            \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   345
    int u0, u1, u2;                 \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   346
    char *dstp = SDL_static_cast(char *, dst);  \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   347
    char *srcp = SDL_static_cast(char *, src);  \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   348
    int n = (len);                  \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   349
    if ( n >= 4 ) {                 \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   350
    __asm__ __volatile__ (              \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   351
        "std\n\t"               \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   352
        "rep ; movsl\n\t"           \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   353
        "cld\n\t"               \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   354
        : "=&c" (u0), "=&D" (u1), "=&S" (u2)    \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   355
        : "0" (n >> 2),             \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   356
          "1" (dstp+(n-4)), "2" (srcp+(n-4))    \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   357
        : "memory" );               \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   358
    }                       \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   359
    switch (n & 3) {                \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   360
        case 3: dstp[2] = srcp[2];      \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   361
        case 2: dstp[1] = srcp[1];      \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   362
        case 1: dstp[0] = srcp[0];      \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   363
            break;              \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   364
        default:                \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   365
            break;              \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   366
    }                       \
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   367
} while(0)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   368
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   369
#ifndef SDL_revcpy
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   370
extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   371
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   372
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   373
#ifdef HAVE_MEMMOVE
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   374
#define SDL_memmove     memmove
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   375
#elif defined(HAVE_BCOPY)
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   376
#define SDL_memmove(d, s, n)    bcopy((s), (d), (n))
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   377
#else
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   378
#define SDL_memmove(dst, src, len)          \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   379
do {                            \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   380
    if ( dst < src ) {              \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   381
        SDL_memcpy(dst, src, len);      \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   382
    } else {                    \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   383
        SDL_revcpy(dst, src, len);      \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   384
    }                       \
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   385
} while(0)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   386
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   387
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   388
#ifdef HAVE_MEMCMP
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   389
#define SDL_memcmp      memcmp
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   390
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   391
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   392
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   393
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   394
#ifdef HAVE_STRLEN
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   395
#define SDL_strlen      strlen
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   396
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   397
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   398
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   399
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   400
#ifdef HAVE_STRLCPY
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   401
#define SDL_strlcpy     strlcpy
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   402
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   403
extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   404
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   405
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   406
#ifdef HAVE_STRLCAT
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   407
#define SDL_strlcat    strlcat
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   408
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   409
extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   410
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   411
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   412
#ifdef HAVE_STRDUP
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   413
#define SDL_strdup     strdup
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   414
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   415
extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   416
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   417
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   418
#ifdef HAVE__STRREV
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   419
#define SDL_strrev      _strrev
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   420
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   421
extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   422
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   423
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   424
#ifdef HAVE__STRUPR
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   425
#define SDL_strupr      _strupr
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   426
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   427
extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   428
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   429
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   430
#ifdef HAVE__STRLWR
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   431
#define SDL_strlwr      _strlwr
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   432
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   433
extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   434
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   435
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   436
#ifdef HAVE_STRCHR
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   437
#define SDL_strchr      strchr
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   438
#elif defined(HAVE_INDEX)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   439
#define SDL_strchr      index
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   440
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   441
extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   442
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   443
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   444
#ifdef HAVE_STRRCHR
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   445
#define SDL_strrchr     strrchr
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   446
#elif defined(HAVE_RINDEX)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   447
#define SDL_strrchr     rindex
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   448
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   449
extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   450
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   451
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   452
#ifdef HAVE_STRSTR
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   453
#define SDL_strstr      strstr
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   454
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   455
extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   456
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   457
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   458
#ifdef HAVE_ITOA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   459
#define SDL_itoa        itoa
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   460
#else
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   461
#define SDL_itoa(value, string, radix)  SDL_ltoa((long)value, string, radix)
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   462
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   463
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   464
#ifdef HAVE__LTOA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   465
#define SDL_ltoa        _ltoa
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   466
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   467
extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   468
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   469
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   470
#ifdef HAVE__UITOA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   471
#define SDL_uitoa       _uitoa
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   472
#else
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   473
#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   474
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   475
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   476
#ifdef HAVE__ULTOA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   477
#define SDL_ultoa       _ultoa
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   478
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   479
extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   480
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   481
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   482
#ifdef HAVE_STRTOL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   483
#define SDL_strtol      strtol
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   484
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   485
extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   486
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   487
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   488
#ifdef HAVE_STRTOUL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   489
#define SDL_strtoul      strtoul
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   490
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   491
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   492
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   493
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   494
#ifdef SDL_HAS_64BIT_TYPE
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   495
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   496
#ifdef HAVE__I64TOA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   497
#define SDL_lltoa       _i64toa
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   498
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   499
extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   500
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   501
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   502
#ifdef HAVE__UI64TOA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   503
#define SDL_ulltoa      _ui64toa
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   504
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   505
extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   506
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   507
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   508
#ifdef HAVE_STRTOLL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   509
#define SDL_strtoll     strtoll
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   510
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   511
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   512
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   513
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   514
#ifdef HAVE_STRTOULL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   515
#define SDL_strtoull     strtoull
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   516
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   517
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   518
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   519
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   520
#endif /* SDL_HAS_64BIT_TYPE */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   521
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   522
#ifdef HAVE_STRTOD
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   523
#define SDL_strtod      strtod
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   524
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   525
extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   526
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   527
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   528
#ifdef HAVE_ATOI
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   529
#define SDL_atoi        atoi
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   530
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   531
#define SDL_atoi(X)     SDL_strtol(X, NULL, 0)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   532
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   533
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   534
#ifdef HAVE_ATOF
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   535
#define SDL_atof        atof
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   536
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   537
#define SDL_atof(X)     SDL_strtod(X, NULL)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   538
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   539
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   540
#ifdef HAVE_STRCMP
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   541
#define SDL_strcmp      strcmp
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   542
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   543
extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   544
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   545
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   546
#ifdef HAVE_STRNCMP
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   547
#define SDL_strncmp     strncmp
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   548
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   549
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   550
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   551
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   552
#ifdef HAVE_STRCASECMP
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   553
#define SDL_strcasecmp  strcasecmp
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   554
#elif defined(HAVE__STRICMP)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   555
#define SDL_strcasecmp  _stricmp
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   556
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   557
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   558
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   559
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   560
#ifdef HAVE_STRNCASECMP
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   561
#define SDL_strncasecmp strncasecmp
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   562
#elif defined(HAVE__STRNICMP)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   563
#define SDL_strncasecmp _strnicmp
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   564
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   565
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   566
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   567
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   568
#ifdef HAVE_SSCANF
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   569
#define SDL_sscanf      sscanf
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   570
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   571
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   572
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   573
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   574
#ifdef HAVE_SNPRINTF
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   575
#define SDL_snprintf    snprintf
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   576
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   577
extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   578
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   579
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   580
#ifdef HAVE_VSNPRINTF
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   581
#define SDL_vsnprintf   vsnprintf
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   582
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   583
extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   584
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   585
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   586
/** @name SDL_ICONV Error Codes
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   587
 *  The SDL implementation of iconv() returns these error codes
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   588
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   589
/*@{*/
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   590
#define SDL_ICONV_ERROR     (size_t)-1
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   591
#define SDL_ICONV_E2BIG     (size_t)-2
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   592
#define SDL_ICONV_EILSEQ    (size_t)-3
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   593
#define SDL_ICONV_EINVAL    (size_t)-4
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   594
/*@}*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   595
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   596
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   597
#define SDL_iconv_t     iconv_t
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   598
#define SDL_iconv_open  iconv_open
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   599
#define SDL_iconv_close iconv_close
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   600
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   601
typedef struct _SDL_iconv_t *SDL_iconv_t;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   602
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   603
extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   604
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   605
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   606
/** This function converts a string between encodings in one pass, returning a
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   607
 *  string that must be freed with SDL_free() or NULL on error.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   608
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   609
extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   610
#define SDL_iconv_utf8_locale(S)    SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   611
#define SDL_iconv_utf8_ucs2(S)      (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   612
#define SDL_iconv_utf8_ucs4(S)      (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   613
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   614
/* Ends C function definitions when using C++ */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   615
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   616
}
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   617
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   618
#include "close_code.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   619
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   620
#endif /* _SDL_stdinc_h */