1 /* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20 */ 21 22 /* These headers are from sdl12-compat, and are intended to give just enough 23 functionality to let you build an SDL-1.2-based project without having the 24 real SDL-1.2 available to you. */ 25 26 /* This is all kinda dicey. Just pretend we have most of these no matter what. 27 Hopefully most apps don't actually rely on this. :/ These defines would 28 need to be correct (and usually generated by a configure script) if these 29 headers were to be used to build the real SDL 1.2, but they are only 30 intended for building apps against sdl12-compat. */ 31 32 #ifndef _SDL_config_h 33 #define _SDL_config_h 34 35 #include "SDL_platform.h" 36 37 /* Make sure that this isn't included by Visual C++ */ 38 #if defined(_MSC_VER) && (_MSC_VER < 1600) 39 typedef __int8 int8_t; 40 typedef unsigned __int8 uint8_t; 41 typedef __int16 int16_t; 42 typedef unsigned __int16 uint16_t; 43 typedef __int32 int32_t; 44 typedef unsigned __int32 uint32_t; 45 typedef __int64 int64_t; 46 typedef unsigned __int64 uint64_t; 47 #else 48 #include <stdint.h> 49 #define HAVE_STDINT_H 1 50 #endif 51 52 #define SDL_HAS_64BIT_TYPE 1 53 54 #include <stdarg.h> 55 #define HAVE_STDARG_H 1 56 57 /* for now, let's try and say everything that we care about that isn't Windows 58 has these C runtime functions available. We're trying to avoid a configure 59 stage, though. Send patches if your platform lacks something. */ 60 #ifndef _WIN32 61 #define HAVE_LIBC 1 62 #define HAVE_SYS_TYPES_H 1 63 #define HAVE_STDIO_H 1 64 #define STDC_HEADERS 1 65 #define HAVE_STDLIB_H 1 66 #define HAVE_MEMORY_H 1 67 #define HAVE_STRING_H 1 68 #define HAVE_STRINGS_H 1 69 #define HAVE_INTTYPES_H 1 70 #define HAVE_CTYPE_H 1 71 #define HAVE_MATH_H 1 72 #endif 73 74 #if defined(__unix__) || defined(__APPLE__) 75 #define HAVE_ICONV_H 1 76 #define HAVE_SIGNAL_H 1 77 #endif 78 79 #if defined(__powerpc__) 80 #define HAVE_ALTIVEC_H 1 81 #endif 82 83 /* SDL 1.2 never defines these for Windows to force SDL's internal implementation. */ 84 #ifndef _WIN32 85 #define HAVE_GETENV 1 86 #define HAVE_PUTENV 1 87 #define HAVE_UNSETENV 1 88 #endif 89 90 /* for now, let's try and say everything that we care about that isn't Windows 91 has these C runtime functions available. We're trying to avoid a configure 92 stage, though. Send patches if your platform lacks something. */ 93 #ifndef _WIN32 94 #define HAVE_MALLOC 1 95 #define HAVE_CALLOC 1 96 #define HAVE_REALLOC 1 97 #define HAVE_FREE 1 98 #define HAVE_ALLOCA 1 99 #define HAVE_QSORT 1 100 #define HAVE_ABS 1 101 #define HAVE_MEMSET 1 102 #define HAVE_MEMCPY 1 103 #define HAVE_MEMMOVE 1 104 #define HAVE_MEMCMP 1 105 #define HAVE_STRLEN 1 106 #define HAVE_STRDUP 1 107 #define HAVE_STRCHR 1 108 #define HAVE_STRRCHR 1 109 #define HAVE_STRSTR 1 110 #define HAVE_STRTOL 1 111 #define HAVE_STRTOUL 1 112 #define HAVE_STRTOLL 1 113 #define HAVE_STRTOULL 1 114 #define HAVE_STRTOD 1 115 #define HAVE_STRCMP 1 116 #define HAVE_STRNCMP 1 117 #define HAVE_STRCASECMP 1 118 #define HAVE_STRNCASECMP 1 119 #define HAVE_SSCANF 1 120 #ifndef __WATCOMC__ /* apparently Watcom C's snprintf is not to be trusted... */ 121 #define HAVE_SNPRINTF 1 122 #define HAVE_VSNPRINTF 1 123 #endif 124 #endif 125 126 /* things that aren't necessarily in Linux, some are MSVC C runtime, some are BSD. Send patches. */ 127 #if 0 128 #define HAVE_MALLOC_H 1 129 #define HAVE_BCOPY 1 130 #define HAVE_ATOI 1 131 #define HAVE_ATOF 1 132 #define HAVE_STRLCPY 1 133 #define HAVE_STRLCAT 1 134 #define HAVE__STRREV 1 135 #define HAVE__STRUPR 1 136 #define HAVE__STRLWR 1 137 #define HAVE_INDEX 1 138 #define HAVE_RINDEX 1 139 #define HAVE_ITOA 1 140 #define HAVE__LTOA 1 141 #define HAVE__UITOA 1 142 #define HAVE__ULTOA 1 143 #define HAVE__I64TOA 1 144 #define HAVE__UI64TOA 1 145 #define HAVE__STRTOI64 1 146 #define HAVE__STRTOUI64 1 147 #define HAVE__STRICMP 1 148 #define HAVE__STRNICMP 1 149 #define HAVE_GETAUXVAL 1 150 #define HAVE_ELF_AUX_INFO 1 151 #define HAVE_NANOSLEEP 1 152 #define HAVE_CLOCK_GETTIME 1 153 #define HAVE_GETPAGESIZE 1 154 #define HAVE_MPROTECT 1 155 #define HAVE_SEM_TIMEDWAIT 1 156 #endif 157 158 #if defined(__unix__) || defined(__APPLE__) 159 #define HAVE_ICONV 1 160 #define HAVE_SIGACTION 1 161 #define HAVE_SA_SIGACTION 1 162 #define HAVE_SETJMP 1 163 #endif 164 165 /* Don't define most of the SDL backends, under the assumption checking for these against the headers won't work anyhow. 166 The exception is the X11 backend; you need its define to know if you can use its syswm interface. */ 167 168 # if defined(__unix__) && !defined(__APPLE__) && defined(__has_include) 169 # if __has_include(<X11/Xlib.h>) 170 # define SDL_VIDEO_DRIVER_X11 1 171 # endif 172 # endif 173 174 #endif /* _SDL_config_h */ 175