include/SDL_config.h.in
author Sam Lantinga <slouken@libsdl.org>
Sun, 16 Jan 2011 15:16:39 -0800
changeset 5004 0c72ae7b7cb2
parent 4873 67ad1c88dda0
child 5041 3ce345cc46f8
permissions -rw-r--r--
Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Changed the CAS return value to bool, so it's efficient with OSAtomicCompareAndSwap32Barrier()
Added an atomic test adapted from code by Michael Davidsaver
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2009 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 #ifndef _SDL_config_h
    24 #define _SDL_config_h
    25 
    26 /**
    27  *  \file SDL_config.h.in
    28  *
    29  *  This is a set of defines to configure the SDL features
    30  */
    31 
    32 /* General platform specific identifiers */
    33 #include "SDL_platform.h"
    34 
    35 /* Make sure that this isn't included by Visual C++ */
    36 #ifdef _MSC_VER
    37 #error You should copy include/SDL_config.h.default to include/SDL_config.h
    38 #endif
    39 
    40 /* C language features */
    41 #undef const
    42 #undef inline
    43 #undef volatile
    44 
    45 /* C datatypes */
    46 #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
    47 #undef size_t
    48 #undef int8_t
    49 #undef uint8_t
    50 #undef int16_t
    51 #undef uint16_t
    52 #undef int32_t
    53 #undef uint32_t
    54 #undef int64_t
    55 #undef uint64_t
    56 #undef uintptr_t
    57 #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
    58 
    59 #undef SIZEOF_VOIDP
    60 #undef SDL_HAS_64BIT_TYPE
    61 #undef HAVE_GCC_ATOMICS
    62 
    63 /* Comment this if you want to build without any C library requirements */
    64 #undef HAVE_LIBC
    65 #if HAVE_LIBC
    66 
    67 /* Useful headers */
    68 #undef HAVE_ALLOCA_H
    69 #undef HAVE_SYS_TYPES_H
    70 #undef HAVE_STDIO_H
    71 #undef STDC_HEADERS
    72 #undef HAVE_STDLIB_H
    73 #undef HAVE_STDARG_H
    74 #undef HAVE_MALLOC_H
    75 #undef HAVE_MEMORY_H
    76 #undef HAVE_STRING_H
    77 #undef HAVE_STRINGS_H
    78 #undef HAVE_INTTYPES_H
    79 #undef HAVE_STDINT_H
    80 #undef HAVE_CTYPE_H
    81 #undef HAVE_MATH_H
    82 #undef HAVE_ICONV_H
    83 #undef HAVE_SIGNAL_H
    84 #undef HAVE_ALTIVEC_H
    85 
    86 /* C library functions */
    87 #undef HAVE_MALLOC
    88 #undef HAVE_CALLOC
    89 #undef HAVE_REALLOC
    90 #undef HAVE_FREE
    91 #undef HAVE_ALLOCA
    92 #ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
    93 #undef HAVE_GETENV
    94 #undef HAVE_SETENV
    95 #undef HAVE_PUTENV
    96 #undef HAVE_UNSETENV
    97 #endif
    98 #undef HAVE_QSORT
    99 #undef HAVE_ABS
   100 #undef HAVE_BCOPY
   101 #undef HAVE_MEMSET
   102 #undef HAVE_MEMCPY
   103 #undef HAVE_MEMMOVE
   104 #undef HAVE_MEMCMP
   105 #undef HAVE_STRLEN
   106 #undef HAVE_STRLCPY
   107 #undef HAVE_STRLCAT
   108 #undef HAVE_STRDUP
   109 #undef HAVE__STRREV
   110 #undef HAVE__STRUPR
   111 #undef HAVE__STRLWR
   112 #undef HAVE_INDEX
   113 #undef HAVE_RINDEX
   114 #undef HAVE_STRCHR
   115 #undef HAVE_STRRCHR
   116 #undef HAVE_STRSTR
   117 #undef HAVE_ITOA
   118 #undef HAVE__LTOA
   119 #undef HAVE__UITOA
   120 #undef HAVE__ULTOA
   121 #undef HAVE_STRTOL
   122 #undef HAVE_STRTOUL
   123 #undef HAVE__I64TOA
   124 #undef HAVE__UI64TOA
   125 #undef HAVE_STRTOLL
   126 #undef HAVE_STRTOULL
   127 #undef HAVE_STRTOD
   128 #undef HAVE_ATOI
   129 #undef HAVE_ATOF
   130 #undef HAVE_STRCMP
   131 #undef HAVE_STRNCMP
   132 #undef HAVE__STRICMP
   133 #undef HAVE_STRCASECMP
   134 #undef HAVE__STRNICMP
   135 #undef HAVE_STRNCASECMP
   136 #undef HAVE_SSCANF
   137 #undef HAVE_SNPRINTF
   138 #undef HAVE_VSNPRINTF
   139 #undef HAVE_M_PI
   140 #undef HAVE_ATAN
   141 #undef HAVE_ATAN2
   142 #undef HAVE_CEIL
   143 #undef HAVE_COPYSIGN
   144 #undef HAVE_COS
   145 #undef HAVE_COSF
   146 #undef HAVE_FABS
   147 #undef HAVE_FLOOR
   148 #undef HAVE_LOG
   149 #undef HAVE_POW
   150 #undef HAVE_SCALBN
   151 #undef HAVE_SIN
   152 #undef HAVE_SINF
   153 #undef HAVE_SQRT
   154 #undef HAVE_SIGACTION
   155 #undef HAVE_SETJMP
   156 #undef HAVE_NANOSLEEP
   157 #undef HAVE_SYSCONF
   158 #undef HAVE_SYSCTLBYNAME
   159 #undef HAVE_CLOCK_GETTIME
   160 #undef HAVE_GETPAGESIZE
   161 #undef HAVE_MPROTECT
   162 
   163 #else
   164 /* We may need some replacement for stdarg.h here */
   165 #include <stdarg.h>
   166 #endif /* HAVE_LIBC */
   167 
   168 /* SDL internal assertion support */
   169 #undef SDL_DEFAULT_ASSERT_LEVEL
   170 
   171 /* Allow disabling of core subsystems */
   172 #undef SDL_AUDIO_DISABLED
   173 #undef SDL_CPUINFO_DISABLED
   174 #undef SDL_EVENTS_DISABLED
   175 #undef SDL_FILE_DISABLED
   176 #undef SDL_JOYSTICK_DISABLED
   177 #undef SDL_HAPTIC_DISABLED
   178 #undef SDL_LOADSO_DISABLED
   179 #undef SDL_THREADS_DISABLED
   180 #undef SDL_TIMERS_DISABLED
   181 #undef SDL_VIDEO_DISABLED
   182 #undef SDL_POWER_DISABLED
   183 
   184 /* Enable various audio drivers */
   185 #undef SDL_AUDIO_DRIVER_ALSA
   186 #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
   187 #undef SDL_AUDIO_DRIVER_ARTS
   188 #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
   189 #undef SDL_AUDIO_DRIVER_PULSEAUDIO
   190 #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
   191 #undef SDL_AUDIO_DRIVER_BEOSAUDIO
   192 #undef SDL_AUDIO_DRIVER_BSD
   193 #undef SDL_AUDIO_DRIVER_COREAUDIO
   194 #undef SDL_AUDIO_DRIVER_DISK
   195 #undef SDL_AUDIO_DRIVER_DUMMY
   196 #undef SDL_AUDIO_DRIVER_DMEDIA
   197 #undef SDL_AUDIO_DRIVER_DSOUND
   198 #undef SDL_AUDIO_DRIVER_ESD
   199 #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
   200 #undef SDL_AUDIO_DRIVER_MMEAUDIO
   201 #undef SDL_AUDIO_DRIVER_NAS
   202 #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
   203 #undef SDL_AUDIO_DRIVER_NDS
   204 #undef SDL_AUDIO_DRIVER_OSS
   205 #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
   206 #undef SDL_AUDIO_DRIVER_PAUDIO
   207 #undef SDL_AUDIO_DRIVER_QSA
   208 #undef SDL_AUDIO_DRIVER_SUNAUDIO
   209 #undef SDL_AUDIO_DRIVER_WINWAVEOUT
   210 #undef SDL_AUDIO_DRIVER_FUSIONSOUND
   211 #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
   212 
   213 /* Enable various input drivers */
   214 #undef SDL_INPUT_LINUXEV
   215 #undef SDL_INPUT_TSLIB
   216 #undef SDL_JOYSTICK_BEOS
   217 #undef SDL_JOYSTICK_DINPUT
   218 #undef SDL_JOYSTICK_DUMMY
   219 #undef SDL_JOYSTICK_IOKIT
   220 #undef SDL_JOYSTICK_LINUX
   221 #undef SDL_JOYSTICK_NDS
   222 #undef SDL_JOYSTICK_RISCOS
   223 #undef SDL_JOYSTICK_WINMM
   224 #undef SDL_JOYSTICK_USBHID
   225 #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
   226 #undef SDL_HAPTIC_DUMMY
   227 #undef SDL_HAPTIC_LINUX
   228 #undef SDL_HAPTIC_IOKIT
   229 #undef SDL_HAPTIC_DINPUT
   230 
   231 /* Enable various shared object loading systems */
   232 #undef SDL_LOADSO_BEOS
   233 #undef SDL_LOADSO_DLCOMPAT
   234 #undef SDL_LOADSO_DLOPEN
   235 #undef SDL_LOADSO_DUMMY
   236 #undef SDL_LOADSO_LDG
   237 #undef SDL_LOADSO_WIN32
   238 
   239 /* Enable various threading systems */
   240 #undef SDL_THREAD_BEOS
   241 #undef SDL_THREAD_NDS
   242 #undef SDL_THREAD_PTHREAD
   243 #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
   244 #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
   245 #undef SDL_THREAD_SPROC
   246 #undef SDL_THREAD_WIN32
   247 
   248 /* Enable various timer systems */
   249 #undef SDL_TIMER_BEOS
   250 #undef SDL_TIMER_DUMMY
   251 #undef SDL_TIMER_NDS
   252 #undef SDL_TIMER_RISCOS
   253 #undef SDL_TIMER_UNIX
   254 #undef SDL_TIMER_WIN32
   255 #undef SDL_TIMER_WINCE
   256 
   257 /* Enable various video drivers */
   258 #undef SDL_VIDEO_DRIVER_BWINDOW
   259 #undef SDL_VIDEO_DRIVER_COCOA
   260 #undef SDL_VIDEO_DRIVER_DIRECTFB
   261 #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
   262 #undef SDL_VIDEO_DRIVER_DUMMY
   263 #undef SDL_VIDEO_DRIVER_FBCON
   264 #undef SDL_VIDEO_DRIVER_NDS
   265 #undef SDL_VIDEO_DRIVER_PHOTON
   266 #undef SDL_VIDEO_DRIVER_QNXGF
   267 #undef SDL_VIDEO_DRIVER_PS3
   268 #undef SDL_VIDEO_DRIVER_RISCOS
   269 #undef SDL_VIDEO_DRIVER_SVGALIB
   270 #undef SDL_VIDEO_DRIVER_WIN32
   271 #undef SDL_VIDEO_DRIVER_X11
   272 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC
   273 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
   274 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
   275 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
   276 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT
   277 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
   278 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XDAMAGE
   279 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES
   280 #undef SDL_VIDEO_DRIVER_X11_VIDMODE
   281 #undef SDL_VIDEO_DRIVER_X11_XINERAMA
   282 #undef SDL_VIDEO_DRIVER_X11_XRANDR
   283 #undef SDL_VIDEO_DRIVER_X11_XINPUT
   284 #undef SDL_VIDEO_DRIVER_X11_SCRNSAVER
   285 #undef SDL_VIDEO_DRIVER_X11_XV
   286 #undef SDL_VIDEO_DRIVER_X11_XRENDER
   287 #undef SDL_VIDEO_DRIVER_X11_XDAMAGE
   288 #undef SDL_VIDEO_DRIVER_X11_XFIXES
   289 #undef SDL_VIDEO_DRIVER_X11_XSHAPE
   290 
   291 #undef SDL_VIDEO_RENDER_D3D
   292 #undef SDL_VIDEO_RENDER_GDI
   293 #undef SDL_VIDEO_RENDER_OGL
   294 #undef SDL_VIDEO_RENDER_OGL_ES
   295 #undef SDL_VIDEO_RENDER_X11
   296 #undef SDL_VIDEO_RENDER_GAPI
   297 #undef SDL_VIDEO_RENDER_DDRAW
   298 
   299 /* Enable OpenGL support */
   300 #undef SDL_VIDEO_OPENGL
   301 #undef SDL_VIDEO_OPENGL_ES
   302 #undef SDL_VIDEO_OPENGL_BGL
   303 #undef SDL_VIDEO_OPENGL_CGL
   304 #undef SDL_VIDEO_OPENGL_GLX
   305 #undef SDL_VIDEO_OPENGL_WGL
   306 #undef SDL_VIDEO_OPENGL_OSMESA
   307 #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
   308 
   309 /* Enable system power support */
   310 #undef SDL_POWER_LINUX
   311 #undef SDL_POWER_WINDOWS
   312 #undef SDL_POWER_MACOSX
   313 #undef SDL_POWER_BEOS
   314 #undef SDL_POWER_NINTENDODS
   315 #undef SDL_POWER_HARDWIRED
   316 
   317 /* Enable assembly routines */
   318 #undef SDL_ASSEMBLY_ROUTINES
   319 #undef SDL_ALTIVEC_BLITTERS
   320 
   321 #endif /* _SDL_config_h */