Godot Engine – Multi-platform 2D and 3D game engine
/**************************************************************************/
/* SDL_build_config_private.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
// Always use standard library to avoid built-in functions changing (see GH-110198).
#define HAVE_LIBC 1
// Standard library headers.
#define HAVE_FLOAT_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_WCHAR_H 1
// Non-standard headers.
#if __has_include(<alloca.h>)
#define HAVE_ALLOCA_H 1
#endif
#if __has_include(<inttypes.h>)
#define HAVE_INTTYPES_H 1
#endif
#if __has_include(<malloc.h>)
#define HAVE_MALLOC_H 1
#endif
#if __has_include(<strings.h>)
#define HAVE_STRINGS_H 1
#endif
#if __has_include(<sys/types.h>)
#define HAVE_SYS_TYPES_H 1
#endif
// Compiler-specific defines.
#ifdef __GNUC__
#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
#endif
// Here we disable SDL subsystems that are not going to be used.
#define SDL_CPUINFO_DISABLED 1
#define SDL_AUDIO_DISABLED 1
#define SDL_PROCESS_DUMMY 1
#define SDL_LOADSO_DUMMY 1
#define SDL_VIDEO_DISABLED 1
#define SDL_CAMERA_DISABLED 1
#define SDL_DIALOG_DISABLED 1
#define SDL_GPU_DISABLED 1
#define SDL_RENDER_DISABLED 1
#define SDL_POWER_DISABLED 1
#define SDL_LEAN_AND_MEAN 1
// Windows defines.
#if defined(WINDOWS_ENABLED)
#define SDL_PLATFORM_PRIVATE_NAME "Windows"
#define HAVE_DINPUT_H 1
#define HAVE_XINPUT_H 1
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 // Windows 10 SDK.
#define HAVE_WINDOWS_GAMING_INPUT_H 1
#define SDL_JOYSTICK_WGI 1
#endif
#define SDL_JOYSTICK_DINPUT 1
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_JOYSTICK_RAWINPUT 1
#define SDL_JOYSTICK_XINPUT 1
#define SDL_HAPTIC_DINPUT 1
#define SDL_THREAD_GENERIC_COND_SUFFIX 1
#define SDL_THREAD_GENERIC_RWLOCK_SUFFIX 1
#define SDL_THREAD_WINDOWS 1
#define SDL_TIMER_WINDOWS 1
#define SDL_SENSOR_WINDOWS 1
#define SDL_FILESYSTEM_WINDOWS 1 // Used by `thirdparty/sdl/joystick/windows/SDL_dinputjoystick.c`.
#define SDL_FSOPS_WINDOWS 1
// Linux defines.
#elif defined(LINUXBSD_ENABLED)
#define SDL_PLATFORM_PRIVATE_NAME "Linux"
#define HAVE_LINUX_INPUT_H 1
#define HAVE_PPOLL 1
#ifdef __linux__
#define HAVE_INOTIFY 1
#define HAVE_INOTIFY_INIT1 1
// Don't add these defines, for some reason they mess with C#'s ability
// to use environment variables (see GH-109024).
//#define HAVE_GETENV 1
//#define HAVE_SETENV 1
//#define HAVE_UNSETENV 1
#endif
#ifdef DBUS_ENABLED
#define HAVE_DBUS_DBUS_H 1
#define SDL_USE_LIBDBUS 1
// SOWRAP_ENABLED is handled in `thirdparty/sdl/core/linux/SDL_dbus.c`.
#endif
#ifdef UDEV_ENABLED
#define HAVE_LIBUDEV_H 1
#define SDL_USE_LIBUDEV
#ifdef SOWRAP_ENABLED
#define SDL_UDEV_DYNAMIC "libudev.so.1"
#endif
#endif
#define SDL_LOADSO_DLOPEN 1
#define SDL_HAPTIC_LINUX 1
#define SDL_TIMER_UNIX 1
#define SDL_JOYSTICK_LINUX 1
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_INPUT_LINUXEV 1
#define SDL_THREAD_PTHREAD 1
#define SDL_FILESYSTEM_DUMMY 1
#define SDL_FSOPS_DUMMY 1
// macOS defines.
#elif defined(MACOS_ENABLED)
#define SDL_PLATFORM_PRIVATE_NAME "macOS"
#define SDL_HAPTIC_IOKIT 1
#define SDL_JOYSTICK_IOKIT 1
#define SDL_JOYSTICK_MFI 1
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_TIMER_UNIX 1
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
#define SDL_FILESYSTEM_DUMMY 1
#define SDL_FSOPS_DUMMY 1
// iOS/visionOS defines.
#elif defined(IOS_ENABLED) || defined(VISIONOS_ENABLED)
#ifdef IOS_ENABLED
#define SDL_PLATFORM_PRIVATE_NAME "iOS"
#else
#define SDL_PLATFORM_PRIVATE_NAME "visionOS"
#endif
#define SDL_JOYSTICK_MFI 1
#define SDL_HAPTIC_DUMMY 1
#define SDL_TIMER_UNIX 1
#define SDL_THREAD_PTHREAD 1
#define SDL_FILESYSTEM_DUMMY 1
#define SDL_FSOPS_DUMMY 1
#define SDL_MAIN_HANDLED 1
// Other platforms are not supported (for now).
#else
#error "No SDL build config was found for this platform. Setup one before compiling the engine."
#endif