Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/drivers/sdl/SDL_build_config_private.h
11352 views
1
/**************************************************************************/
2
/* SDL_build_config_private.h */
3
/**************************************************************************/
4
/* This file is part of: */
5
/* GODOT ENGINE */
6
/* https://godotengine.org */
7
/**************************************************************************/
8
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10
/* */
11
/* Permission is hereby granted, free of charge, to any person obtaining */
12
/* a copy of this software and associated documentation files (the */
13
/* "Software"), to deal in the Software without restriction, including */
14
/* without limitation the rights to use, copy, modify, merge, publish, */
15
/* distribute, sublicense, and/or sell copies of the Software, and to */
16
/* permit persons to whom the Software is furnished to do so, subject to */
17
/* the following conditions: */
18
/* */
19
/* The above copyright notice and this permission notice shall be */
20
/* included in all copies or substantial portions of the Software. */
21
/* */
22
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29
/**************************************************************************/
30
31
#pragma once
32
33
#define SDL_build_config_h_
34
35
#include <SDL3/SDL_platform_defines.h>
36
37
#define HAVE_STDARG_H 1
38
#define HAVE_STDDEF_H 1
39
40
// Here we disable SDL subsystems that are not going to be used
41
#define SDL_CPUINFO_DISABLED 1
42
#define SDL_AUDIO_DISABLED 1
43
#define SDL_PROCESS_DUMMY 1
44
#define SDL_LOADSO_DUMMY 1
45
#define SDL_VIDEO_DISABLED 1
46
#define SDL_CAMERA_DISABLED 1
47
#define SDL_DIALOG_DISABLED 1
48
#define SDL_FILESYSTEM_DUMMY 1
49
#define SDL_FSOPS_DUMMY 1
50
#define SDL_SENSOR_DISABLED 1
51
#define SDL_GPU_DISABLED 1
52
#define SDL_RENDER_DISABLED 1
53
#define SDL_POWER_DISABLED 1
54
#define SDL_LEAN_AND_MEAN 1
55
56
// Windows defines
57
#if defined(SDL_PLATFORM_WINDOWS)
58
59
#define SDL_PLATFORM_PRIVATE_NAME "Windows"
60
#define HAVE_LIBC 1
61
#define HAVE_DINPUT_H 1
62
#define HAVE_XINPUT_H 1
63
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */
64
#define HAVE_WINDOWS_GAMING_INPUT_H 1
65
#define SDL_JOYSTICK_WGI 1
66
#endif
67
#define SDL_JOYSTICK_DINPUT 1
68
#define SDL_JOYSTICK_HIDAPI 1
69
#define SDL_JOYSTICK_RAWINPUT 1
70
#define SDL_JOYSTICK_XINPUT 1
71
#define SDL_HAPTIC_DINPUT 1
72
#define SDL_THREAD_GENERIC_COND_SUFFIX 1
73
#define SDL_THREAD_GENERIC_RWLOCK_SUFFIX 1
74
#define SDL_THREAD_WINDOWS 1
75
#define SDL_TIMER_WINDOWS 1
76
77
// Linux defines
78
#elif defined(SDL_PLATFORM_LINUX)
79
80
#define SDL_PLATFORM_PRIVATE_NAME "Linux"
81
#define SDL_PLATFORM_UNIX 1
82
83
#define HAVE_STDIO_H 1
84
#define HAVE_LIBC 1
85
#define HAVE_LINUX_INPUT_H 1
86
#define HAVE_POLL 1
87
88
#ifdef __linux__
89
#define HAVE_INOTIFY 1
90
#define HAVE_INOTIFY_INIT1 1
91
// Don't add these defines, for some reason they mess with C#'s ability
92
// to use environment variables (see GH-109024)
93
//#define HAVE_GETENV 1
94
//#define HAVE_SETENV 1
95
//#define HAVE_UNSETENV 1
96
#endif
97
98
#ifdef DBUS_ENABLED
99
#define HAVE_DBUS_DBUS_H 1
100
#define SDL_USE_LIBDBUS 1
101
// SOWRAP_ENABLED is handled in thirdparty/sdl/core/linux/SDL_dbus.c
102
#endif
103
104
#ifdef UDEV_ENABLED
105
#define HAVE_LIBUDEV_H 1
106
#define SDL_USE_LIBUDEV
107
#ifdef SOWRAP_ENABLED
108
#define SDL_UDEV_DYNAMIC "libudev.so.1"
109
#endif
110
#endif
111
112
#define SDL_LOADSO_DLOPEN 1
113
#define SDL_HAPTIC_LINUX 1
114
#define SDL_TIMER_UNIX 1
115
#define SDL_JOYSTICK_LINUX 1
116
#define SDL_INPUT_LINUXEV 1
117
#define SDL_THREAD_PTHREAD 1
118
119
// MacOS defines
120
#elif defined(SDL_PLATFORM_MACOS)
121
122
#define SDL_PLATFORM_PRIVATE_NAME "macOS"
123
#define SDL_PLATFORM_UNIX 1
124
#define HAVE_STDIO_H 1
125
#define HAVE_LIBC 1
126
#define SDL_HAPTIC_IOKIT 1
127
#define SDL_JOYSTICK_IOKIT 1
128
#define SDL_JOYSTICK_MFI 1
129
#define SDL_TIMER_UNIX 1
130
#define SDL_THREAD_PTHREAD 1
131
132
// Other platforms are not supported (for now)
133
#else
134
#error "No SDL build config was found for this platform. Setup one before compiling the engine."
135
#endif
136
137
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
138
#define HAVE_STDINT_H 1
139
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
140
141
#ifdef __GNUC__
142
#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
143
#endif
144
145