ruby2d 0.11.3 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/GLES2/gl2.h +656 -0
  3. data/assets/include/GLES2/gl2ext.h +3949 -0
  4. data/assets/include/GLES2/gl2ext_angle.h +701 -0
  5. data/assets/include/GLES2/gl2platform.h +27 -0
  6. data/assets/include/GLES3/gl3.h +1192 -0
  7. data/assets/include/GLES3/gl31.h +1507 -0
  8. data/assets/include/GLES3/gl32.h +1808 -0
  9. data/assets/include/GLES3/gl3platform.h +27 -0
  10. data/assets/include/KHR/khrplatform.h +290 -0
  11. data/assets/include/SDL2/SDL.h +1 -0
  12. data/assets/include/SDL2/SDL_assert.h +4 -2
  13. data/assets/include/SDL2/SDL_atomic.h +20 -0
  14. data/assets/include/SDL2/SDL_audio.h +40 -4
  15. data/assets/include/SDL2/SDL_blendmode.h +4 -6
  16. data/assets/include/SDL2/SDL_clipboard.h +47 -0
  17. data/assets/include/SDL2/SDL_config.h +6 -2
  18. data/assets/include/SDL2/SDL_config_android.h +2 -0
  19. data/assets/include/SDL2/SDL_config_emscripten.h +2 -0
  20. data/assets/include/SDL2/SDL_config_iphoneos.h +3 -1
  21. data/assets/include/SDL2/SDL_config_macosx.h +3 -6
  22. data/assets/include/SDL2/SDL_config_minimal.h +18 -11
  23. data/assets/include/SDL2/SDL_config_ngage.h +89 -0
  24. data/assets/include/SDL2/SDL_config_os2.h +5 -3
  25. data/assets/include/SDL2/SDL_config_pandora.h +1 -0
  26. data/assets/include/SDL2/SDL_config_windows.h +71 -45
  27. data/assets/include/SDL2/SDL_config_wingdk.h +253 -0
  28. data/assets/include/SDL2/SDL_config_winrt.h +11 -49
  29. data/assets/include/SDL2/SDL_config_xbox.h +235 -0
  30. data/assets/include/SDL2/SDL_cpuinfo.h +39 -4
  31. data/assets/include/SDL2/SDL_egl.h +59 -9
  32. data/assets/include/SDL2/SDL_endian.h +34 -3
  33. data/assets/include/SDL2/SDL_events.h +32 -1
  34. data/assets/include/SDL2/SDL_filesystem.h +5 -1
  35. data/assets/include/SDL2/SDL_gamecontroller.h +78 -5
  36. data/assets/include/SDL2/SDL_guid.h +100 -0
  37. data/assets/include/SDL2/SDL_hints.h +645 -43
  38. data/assets/include/SDL2/SDL_image.h +2045 -33
  39. data/assets/include/SDL2/SDL_joystick.h +127 -7
  40. data/assets/include/SDL2/SDL_keyboard.h +38 -1
  41. data/assets/include/SDL2/SDL_keycode.h +6 -1
  42. data/assets/include/SDL2/SDL_log.h +2 -2
  43. data/assets/include/SDL2/SDL_main.h +42 -2
  44. data/assets/include/SDL2/SDL_metal.h +2 -1
  45. data/assets/include/SDL2/SDL_mixer.h +2529 -396
  46. data/assets/include/SDL2/SDL_mouse.h +12 -1
  47. data/assets/include/SDL2/SDL_opengl.h +0 -51
  48. data/assets/include/SDL2/SDL_opengl_glext.h +2260 -231
  49. data/assets/include/SDL2/SDL_opengles2_gl2.h +374 -339
  50. data/assets/include/SDL2/SDL_opengles2_gl2ext.h +3479 -1496
  51. data/assets/include/SDL2/SDL_opengles2_gl2platform.h +6 -9
  52. data/assets/include/SDL2/SDL_opengles2_khrplatform.h +43 -14
  53. data/assets/include/SDL2/SDL_platform.h +32 -6
  54. data/assets/include/SDL2/SDL_rect.h +154 -2
  55. data/assets/include/SDL2/SDL_render.h +46 -17
  56. data/assets/include/SDL2/SDL_revision.h +4 -0
  57. data/assets/include/SDL2/SDL_rwops.h +1 -15
  58. data/assets/include/SDL2/SDL_scancode.h +46 -21
  59. data/assets/include/SDL2/SDL_sensor.h +24 -3
  60. data/assets/include/SDL2/SDL_stdinc.h +119 -8
  61. data/assets/include/SDL2/SDL_surface.h +3 -1
  62. data/assets/include/SDL2/SDL_system.h +66 -6
  63. data/assets/include/SDL2/SDL_syswm.h +2 -0
  64. data/assets/include/SDL2/SDL_test_common.h +1 -0
  65. data/assets/include/SDL2/SDL_test_font.h +90 -3
  66. data/assets/include/SDL2/SDL_thread.h +3 -3
  67. data/assets/include/SDL2/SDL_touch.h +8 -0
  68. data/assets/include/SDL2/SDL_ttf.h +2084 -155
  69. data/assets/include/SDL2/SDL_version.h +19 -3
  70. data/assets/include/SDL2/SDL_video.h +71 -9
  71. data/assets/include/SDL2/begin_code.h +4 -4
  72. data/assets/include/mrbconf.h +15 -17
  73. data/assets/include/mruby/array.h +8 -21
  74. data/assets/include/mruby/boxing_nan.h +115 -86
  75. data/assets/include/mruby/boxing_word.h +104 -78
  76. data/assets/include/mruby/common.h +6 -0
  77. data/assets/include/mruby/compile.h +3 -4
  78. data/assets/include/mruby/debug.h +4 -2
  79. data/assets/include/mruby/dump.h +5 -2
  80. data/assets/include/mruby/error.h +12 -2
  81. data/assets/include/mruby/gc.h +2 -0
  82. data/assets/include/mruby/hash.h +1 -3
  83. data/assets/include/mruby/irep.h +4 -4
  84. data/assets/include/mruby/numeric.h +21 -13
  85. data/assets/include/mruby/opcode.h +30 -0
  86. data/assets/include/mruby/ops.h +99 -101
  87. data/assets/include/mruby/presym/scanning.h +15 -9
  88. data/assets/include/mruby/proc.h +4 -2
  89. data/assets/include/mruby/string.h +3 -24
  90. data/assets/include/mruby/value.h +80 -40
  91. data/assets/include/mruby/variable.h +0 -15
  92. data/assets/include/mruby/version.h +5 -5
  93. data/assets/include/mruby.h +86 -16
  94. data/assets/macos/universal/bin/mrbc +0 -0
  95. data/assets/macos/universal/lib/libFLAC.a +0 -0
  96. data/assets/macos/universal/lib/libSDL2.a +0 -0
  97. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  98. data/assets/macos/universal/lib/libSDL2_mixer.a +0 -0
  99. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  100. data/assets/macos/universal/lib/libavif.a +0 -0
  101. data/assets/macos/universal/lib/libbrotlicommon-static.a +0 -0
  102. data/assets/macos/universal/lib/libbrotlidec-static.a +0 -0
  103. data/assets/macos/universal/lib/libfreetype.a +0 -0
  104. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  105. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  106. data/assets/macos/universal/lib/libhwy.a +0 -0
  107. data/assets/macos/universal/lib/libjpeg.a +0 -0
  108. data/assets/macos/universal/lib/libjxl.a +0 -0
  109. data/assets/macos/universal/lib/libmodplug.a +0 -0
  110. data/assets/macos/universal/lib/libmpg123.a +0 -0
  111. data/assets/macos/universal/lib/libmruby.a +0 -0
  112. data/assets/macos/universal/lib/libogg.a +0 -0
  113. data/assets/macos/universal/lib/libpng.a +0 -0
  114. data/assets/macos/universal/lib/libtiff.a +0 -0
  115. data/assets/macos/universal/lib/libvorbis.a +0 -0
  116. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  117. data/assets/macos/universal/lib/libwebp.a +0 -0
  118. data/assets/macos/universal/lib/libzstd.a +0 -0
  119. data/assets/wasm/template.html +2 -1
  120. data/assets/windows/mingw-w64-ucrt-x86_64/bin/mrbc.exe +0 -0
  121. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libFLAC.a +0 -0
  122. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libLerc.a +0 -0
  123. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2.a +0 -0
  124. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_image.a +0 -0
  125. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_mixer.a +0 -0
  126. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_ttf.a +0 -0
  127. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlicommon.a +0 -0
  128. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlidec.a +0 -0
  129. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libdeflate.a +0 -0
  130. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libfreetype.a +0 -0
  131. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libglew32.a +0 -0
  132. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libharfbuzz.a +0 -0
  133. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libhwy.a +0 -0
  134. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjpeg.a +0 -0
  135. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjxl.a +0 -0
  136. data/assets/windows/mingw-w64-ucrt-x86_64/lib/liblzma.a +0 -0
  137. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmpg123.a +0 -0
  138. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmruby.a +0 -0
  139. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopus.a +0 -0
  140. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libpng.a +0 -0
  141. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libsndfile.a +0 -0
  142. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libssp.a +0 -0
  143. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libstdc++.a +0 -0
  144. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libtiff.a +0 -0
  145. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libwebp.a +0 -0
  146. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libz.a +0 -0
  147. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  148. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  149. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  150. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  151. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  152. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  153. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  154. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  155. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  156. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  157. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  158. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  159. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  160. data/assets/windows/mingw-w64-x86_64/lib/libhwy.a +0 -0
  161. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  162. data/assets/windows/mingw-w64-x86_64/lib/libjxl.a +0 -0
  163. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  164. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  165. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  166. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  167. data/assets/windows/mingw-w64-x86_64/lib/libpng.a +0 -0
  168. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  169. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  170. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  171. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  172. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  173. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  174. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  175. data/ext/ruby2d/canvas.c +540 -0
  176. data/ext/ruby2d/extconf.rb +33 -20
  177. data/ext/ruby2d/gl.c +3 -3
  178. data/ext/ruby2d/image.c +7 -7
  179. data/ext/ruby2d/ruby2d.c +741 -24
  180. data/ext/ruby2d/ruby2d.h +66 -3
  181. data/ext/ruby2d/sound.c +16 -2
  182. data/lib/ruby2d/canvas.rb +315 -0
  183. data/lib/ruby2d/circle.rb +30 -15
  184. data/lib/ruby2d/cli/build.rb +5 -3
  185. data/lib/ruby2d/cli/enable_console.rb +3 -1
  186. data/lib/ruby2d/color.rb +133 -77
  187. data/lib/ruby2d/core.rb +32 -0
  188. data/lib/ruby2d/dsl.rb +38 -32
  189. data/lib/ruby2d/exceptions.rb +2 -1
  190. data/lib/ruby2d/font.rb +97 -62
  191. data/lib/ruby2d/image.rb +48 -27
  192. data/lib/ruby2d/line.rb +84 -45
  193. data/lib/ruby2d/music.rb +33 -23
  194. data/lib/ruby2d/pixel.rb +10 -9
  195. data/lib/ruby2d/pixmap.rb +39 -0
  196. data/lib/ruby2d/pixmap_atlas.rb +56 -0
  197. data/lib/ruby2d/quad.rb +98 -49
  198. data/lib/ruby2d/rectangle.rb +35 -36
  199. data/lib/ruby2d/renderable.rb +7 -6
  200. data/lib/ruby2d/sound.rb +23 -17
  201. data/lib/ruby2d/sprite.rb +181 -140
  202. data/lib/ruby2d/square.rb +21 -20
  203. data/lib/ruby2d/text.rb +47 -19
  204. data/lib/ruby2d/texture.rb +13 -3
  205. data/lib/ruby2d/tileset.rb +97 -44
  206. data/lib/ruby2d/triangle.rb +91 -42
  207. data/lib/ruby2d/version.rb +3 -1
  208. data/lib/ruby2d/vertices.rb +81 -45
  209. data/lib/ruby2d/window.rb +508 -371
  210. data/lib/ruby2d.rb +11 -29
  211. metadata +51 -16
  212. data/assets/include/SDL2/SDL_config_psp.h +0 -165
  213. data/assets/include/SDL2/SDL_config_wiz.h +0 -154
  214. data/assets/include/glew.h +0 -23686
  215. data/assets/macos/universal/lib/libpng16.a +0 -0
  216. data/assets/windows/glew/README.md +0 -10
  217. data/assets/windows/glew/glew.h +0 -23686
  218. data/assets/windows/glew/libglew32.a +0 -0
  219. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libpng16.a +0 -0
  220. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  221. data/lib/ruby2d/entity.rb +0 -17
@@ -42,56 +42,16 @@
42
42
 
43
43
  /* This is a set of defines to configure the SDL features */
44
44
 
45
- #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
46
- #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
47
- #define HAVE_STDINT_H 1
48
- #elif defined(_MSC_VER)
49
- typedef signed __int8 int8_t;
50
- typedef unsigned __int8 uint8_t;
51
- typedef signed __int16 int16_t;
52
- typedef unsigned __int16 uint16_t;
53
- typedef signed __int32 int32_t;
54
- typedef unsigned __int32 uint32_t;
55
- typedef signed __int64 int64_t;
56
- typedef unsigned __int64 uint64_t;
57
- #ifndef _UINTPTR_T_DEFINED
58
- #ifdef _WIN64
59
- typedef unsigned __int64 uintptr_t;
60
- #else
61
- typedef unsigned int uintptr_t;
62
- #endif
63
- #define _UINTPTR_T_DEFINED
64
- #endif
65
- /* Older Visual C++ headers don't have the Win64-compatible typedefs... */
66
- #if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
67
- #define DWORD_PTR DWORD
68
- #endif
69
- #if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
70
- #define LONG_PTR LONG
71
- #endif
72
- #else /* !__GNUC__ && !_MSC_VER */
73
- typedef signed char int8_t;
74
- typedef unsigned char uint8_t;
75
- typedef signed short int16_t;
76
- typedef unsigned short uint16_t;
77
- typedef signed int int32_t;
78
- typedef unsigned int uint32_t;
79
- typedef signed long long int64_t;
80
- typedef unsigned long long uint64_t;
81
- #ifndef _SIZE_T_DEFINED_
82
- #define _SIZE_T_DEFINED_
83
- typedef unsigned int size_t;
84
- #endif
85
- typedef unsigned int uintptr_t;
86
- #endif /* __GNUC__ || _MSC_VER */
87
- #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
88
-
89
45
  #ifdef _WIN64
90
46
  # define SIZEOF_VOIDP 8
91
47
  #else
92
48
  # define SIZEOF_VOIDP 4
93
49
  #endif
94
50
 
51
+ #ifdef __clang__
52
+ # define HAVE_GCC_ATOMICS 1
53
+ #endif
54
+
95
55
  /* Useful headers */
96
56
  #define HAVE_DXGI_H 1
97
57
  #if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
@@ -109,6 +69,7 @@ typedef unsigned int uintptr_t;
109
69
  #define HAVE_LIMITS_H 1
110
70
  #define HAVE_MATH_H 1
111
71
  #define HAVE_SIGNAL_H 1
72
+ #define HAVE_STDINT_H 1
112
73
  #define HAVE_STDIO_H 1
113
74
  #define HAVE_STRING_H 1
114
75
 
@@ -119,6 +80,7 @@ typedef unsigned int uintptr_t;
119
80
  #define HAVE_FREE 1
120
81
  #define HAVE_ALLOCA 1
121
82
  #define HAVE_QSORT 1
83
+ #define HAVE_BSEARCH 1
122
84
  #define HAVE_ABS 1
123
85
  #define HAVE_MEMSET 1
124
86
  #define HAVE_MEMCPY 1
@@ -191,6 +153,8 @@ typedef unsigned int uintptr_t;
191
153
  #define HAVE_TRUNCF 1
192
154
  #define HAVE__FSEEKI64 1
193
155
 
156
+ #define HAVE_ROAPI_H 1
157
+
194
158
  /* Enable various audio drivers */
195
159
  #define SDL_AUDIO_DRIVER_WASAPI 1
196
160
  #define SDL_AUDIO_DRIVER_DISK 1
@@ -243,6 +207,9 @@ typedef unsigned int uintptr_t;
243
207
  /* Enable appropriate renderer(s) */
244
208
  #define SDL_VIDEO_RENDER_D3D11 1
245
209
 
210
+ /* Disable D3D12 as it's not implemented for WinRT */
211
+ #define SDL_VIDEO_RENDER_D3D12 0
212
+
246
213
  #if SDL_VIDEO_OPENGL_ES2
247
214
  #define SDL_VIDEO_RENDER_OGL_ES2 1
248
215
  #endif
@@ -250,9 +217,4 @@ typedef unsigned int uintptr_t;
250
217
  /* Enable system power support */
251
218
  #define SDL_POWER_WINRT 1
252
219
 
253
- /* Enable assembly routines (Win64 doesn't have inline asm) */
254
- #ifndef _WIN64
255
- #define SDL_ASSEMBLY_ROUTINES 1
256
- #endif
257
-
258
220
  #endif /* SDL_config_winrt_h_ */
@@ -0,0 +1,235 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2022 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
+ #ifndef SDL_config_wingdk_h_
23
+ #define SDL_config_wingdk_h_
24
+ #define SDL_config_h_
25
+
26
+ #include "SDL_platform.h"
27
+
28
+ /* Windows GDK does not need Windows SDK version checks because it requires
29
+ * a recent version of the Windows 10 SDK. */
30
+
31
+ /* GDK only supports 64-bit */
32
+ # define SIZEOF_VOIDP 8
33
+
34
+ #ifdef __clang__
35
+ # define HAVE_GCC_ATOMICS 1
36
+ #endif
37
+
38
+ /*#define HAVE_DDRAW_H 1*/
39
+ /*#define HAVE_DINPUT_H 1*/
40
+ /*#define HAVE_DSOUND_H 1*/
41
+ /* No SDK version checks needed for these because the SDK has to be new. */
42
+ /* #define HAVE_DXGI_H 1 */
43
+ #define HAVE_XINPUT_H 1
44
+ /*#define HAVE_WINDOWS_GAMING_INPUT_H 1*/
45
+ /*#define HAVE_D3D11_H 1*/
46
+ /*#define HAVE_ROAPI_H 1*/
47
+ #define HAVE_D3D12_H 1
48
+ /*#define HAVE_SHELLSCALINGAPI_H 1*/
49
+ #define HAVE_MMDEVICEAPI_H 1
50
+ #define HAVE_AUDIOCLIENT_H 1
51
+ /*#define HAVE_TPCSHRD_H 1*/
52
+ /*#define HAVE_SENSORSAPI_H 1*/
53
+ #if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
54
+ #define HAVE_IMMINTRIN_H 1
55
+ #elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
56
+ # if __has_include(<immintrin.h>)
57
+ # define HAVE_IMMINTRIN_H 1
58
+ # endif
59
+ #endif
60
+
61
+ /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
62
+ #ifdef HAVE_LIBC
63
+ /* Useful headers */
64
+ #define STDC_HEADERS 1
65
+ #define HAVE_CTYPE_H 1
66
+ #define HAVE_FLOAT_H 1
67
+ #define HAVE_LIMITS_H 1
68
+ #define HAVE_MATH_H 1
69
+ #define HAVE_SIGNAL_H 1
70
+ #define HAVE_STDINT_H 1
71
+ #define HAVE_STDIO_H 1
72
+ #define HAVE_STRING_H 1
73
+
74
+ /* C library functions */
75
+ #define HAVE_MALLOC 1
76
+ #define HAVE_CALLOC 1
77
+ #define HAVE_REALLOC 1
78
+ #define HAVE_FREE 1
79
+ #define HAVE_ALLOCA 1
80
+ #define HAVE_QSORT 1
81
+ #define HAVE_BSEARCH 1
82
+ #define HAVE_ABS 1
83
+ #define HAVE_MEMSET 1
84
+ #define HAVE_MEMCPY 1
85
+ #define HAVE_MEMMOVE 1
86
+ #define HAVE_MEMCMP 1
87
+ #define HAVE_STRLEN 1
88
+ #define HAVE__STRREV 1
89
+ /* These functions have security warnings, so we won't use them */
90
+ /* #undef HAVE__STRUPR */
91
+ /* #undef HAVE__STRLWR */
92
+ #define HAVE_STRCHR 1
93
+ #define HAVE_STRRCHR 1
94
+ #define HAVE_STRSTR 1
95
+ /* #undef HAVE_STRTOK_R */
96
+ /* These functions have security warnings, so we won't use them */
97
+ /* #undef HAVE__LTOA */
98
+ /* #undef HAVE__ULTOA */
99
+ #define HAVE_STRTOL 1
100
+ #define HAVE_STRTOUL 1
101
+ #define HAVE_STRTOD 1
102
+ #define HAVE_ATOI 1
103
+ #define HAVE_ATOF 1
104
+ #define HAVE_STRCMP 1
105
+ #define HAVE_STRNCMP 1
106
+ #define HAVE__STRICMP 1
107
+ #define HAVE__STRNICMP 1
108
+ #define HAVE__WCSICMP 1
109
+ #define HAVE__WCSNICMP 1
110
+ #define HAVE__WCSDUP 1
111
+ #define HAVE_ACOS 1
112
+ #define HAVE_ASIN 1
113
+ #define HAVE_ATAN 1
114
+ #define HAVE_ATAN2 1
115
+ #define HAVE_CEIL 1
116
+ #define HAVE_COS 1
117
+ #define HAVE_EXP 1
118
+ #define HAVE_FABS 1
119
+ #define HAVE_FLOOR 1
120
+ #define HAVE_FMOD 1
121
+ #define HAVE_LOG 1
122
+ #define HAVE_LOG10 1
123
+ #define HAVE_POW 1
124
+ #define HAVE_SIN 1
125
+ #define HAVE_SQRT 1
126
+ #define HAVE_TAN 1
127
+ #define HAVE_ACOSF 1
128
+ #define HAVE_ASINF 1
129
+ #define HAVE_ATANF 1
130
+ #define HAVE_ATAN2F 1
131
+ #define HAVE_CEILF 1
132
+ #define HAVE__COPYSIGN 1
133
+ #define HAVE_COSF 1
134
+ #define HAVE_EXPF 1
135
+ #define HAVE_FABSF 1
136
+ #define HAVE_FLOORF 1
137
+ #define HAVE_FMODF 1
138
+ #define HAVE_LOGF 1
139
+ #define HAVE_LOG10F 1
140
+ #define HAVE_POWF 1
141
+ #define HAVE_SINF 1
142
+ #define HAVE_SQRTF 1
143
+ #define HAVE_TANF 1
144
+ #if defined(_MSC_VER)
145
+ /* These functions were added with the VC++ 2013 C runtime library */
146
+ #define HAVE_STRTOLL 1
147
+ #define HAVE_STRTOULL 1
148
+ #define HAVE_VSSCANF 1
149
+ #define HAVE_LROUND 1
150
+ #define HAVE_LROUNDF 1
151
+ #define HAVE_ROUND 1
152
+ #define HAVE_ROUNDF 1
153
+ #define HAVE_SCALBN 1
154
+ #define HAVE_SCALBNF 1
155
+ #define HAVE_TRUNC 1
156
+ #define HAVE_TRUNCF 1
157
+ #define HAVE__FSEEKI64 1
158
+ #ifdef _USE_MATH_DEFINES
159
+ #define HAVE_M_PI 1
160
+ #endif
161
+ #else
162
+ #define HAVE_M_PI 1
163
+ #endif
164
+ #else
165
+ #define HAVE_STDARG_H 1
166
+ #define HAVE_STDDEF_H 1
167
+ #define HAVE_STDINT_H 1
168
+ #endif
169
+
170
+ /* Enable various audio drivers */
171
+ #if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)
172
+ #define SDL_AUDIO_DRIVER_WASAPI 1
173
+ #endif
174
+ /*#define SDL_AUDIO_DRIVER_DSOUND 1*/
175
+ /*#define SDL_AUDIO_DRIVER_WINMM 1*/
176
+ #define SDL_AUDIO_DRIVER_DISK 1
177
+ #define SDL_AUDIO_DRIVER_DUMMY 1
178
+
179
+ /* Enable various input drivers */
180
+ /*#define SDL_JOYSTICK_DINPUT 1*/
181
+ /*#define SDL_JOYSTICK_HIDAPI 1*/
182
+ /*#define SDL_JOYSTICK_RAWINPUT 1*/
183
+ #define SDL_JOYSTICK_VIRTUAL 1
184
+ #ifdef HAVE_WINDOWS_GAMING_INPUT_H
185
+ #define SDL_JOYSTICK_WGI 1
186
+ #endif
187
+ #define SDL_JOYSTICK_XINPUT 1
188
+ /*#define SDL_HAPTIC_DINPUT 1*/
189
+ #define SDL_HAPTIC_XINPUT 1
190
+
191
+ /* Enable the sensor driver */
192
+ #ifdef HAVE_SENSORSAPI_H
193
+ #define SDL_SENSOR_WINDOWS 1
194
+ #else
195
+ #define SDL_SENSOR_DUMMY 1
196
+ #endif
197
+
198
+ /* Enable various shared object loading systems */
199
+ #define SDL_LOADSO_WINDOWS 1
200
+
201
+ /* Enable various threading systems */
202
+ #define SDL_THREAD_GENERIC_COND_SUFFIX 1
203
+ #define SDL_THREAD_WINDOWS 1
204
+
205
+ /* Enable various timer systems */
206
+ #define SDL_TIMER_WINDOWS 1
207
+
208
+ /* Enable various video drivers */
209
+ #define SDL_VIDEO_DRIVER_DUMMY 1
210
+ #define SDL_VIDEO_DRIVER_WINDOWS 1
211
+
212
+ /* #ifndef SDL_VIDEO_RENDER_D3D
213
+ #define SDL_VIDEO_RENDER_D3D 1
214
+ #endif*/
215
+ #if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
216
+ #define SDL_VIDEO_RENDER_D3D11 1
217
+ #endif
218
+ #if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
219
+ #define SDL_VIDEO_RENDER_D3D12 1
220
+ #endif
221
+
222
+ /* Enable system power support */
223
+ /*#define SDL_POWER_WINDOWS 1*/
224
+ #define SDL_POWER_HARDWIRED 1
225
+
226
+ /* Enable filesystem support */
227
+ /* #define SDL_FILESYSTEM_WINDOWS 1*/
228
+ #define SDL_FILESYSTEM_XBOX 1
229
+
230
+ /* Disable IME as not supported yet (TODO: Xbox IME?) */
231
+ #define SDL_DISABLE_WINDOWS_IME 1
232
+
233
+ #endif /* SDL_config_wingdk_h_ */
234
+
235
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -79,7 +79,7 @@ _m_prefetch(void *__P)
79
79
  #if !defined(SDL_DISABLE_ARM_NEON_H)
80
80
  # if defined(__ARM_NEON)
81
81
  # include <arm_neon.h>
82
- # elif defined(__WINDOWS__) || defined(__WINRT__)
82
+ # elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)
83
83
  /* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
84
84
  # if defined(_M_ARM)
85
85
  # include <armintr.h>
@@ -90,6 +90,7 @@ _m_prefetch(void *__P)
90
90
  # include <arm64intr.h>
91
91
  # include <arm64_neon.h>
92
92
  # define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
93
+ # define __ARM_ARCH 8
93
94
  # endif
94
95
  # endif
95
96
  #endif
@@ -98,6 +99,14 @@ _m_prefetch(void *__P)
98
99
  #if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
99
100
  #include <mm3dnow.h>
100
101
  #endif
102
+ #if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H)
103
+ #include <lsxintrin.h>
104
+ #define __LSX__
105
+ #endif
106
+ #if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H)
107
+ #include <lasxintrin.h>
108
+ #define __LASX__
109
+ #endif
101
110
  #if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
102
111
  #include <immintrin.h>
103
112
  #else
@@ -433,10 +442,36 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
433
442
  */
434
443
  extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
435
444
 
445
+ /**
446
+ * Determine whether the CPU has LSX (LOONGARCH SIMD) features.
447
+ *
448
+ * This always returns false on CPUs that aren't using LOONGARCH instruction
449
+ * sets.
450
+ *
451
+ * \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if
452
+ * not.
453
+ *
454
+ * \since This function is available since SDL 2.24.0.
455
+ */
456
+ extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
457
+
458
+ /**
459
+ * Determine whether the CPU has LASX (LOONGARCH SIMD) features.
460
+ *
461
+ * This always returns false on CPUs that aren't using LOONGARCH instruction
462
+ * sets.
463
+ *
464
+ * \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if
465
+ * not.
466
+ *
467
+ * \since This function is available since SDL 2.24.0.
468
+ */
469
+ extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
470
+
436
471
  /**
437
472
  * Get the amount of RAM configured in the system.
438
473
  *
439
- * \returns the amount of RAM configured in the system in MB.
474
+ * \returns the amount of RAM configured in the system in MiB.
440
475
  *
441
476
  * \since This function is available since SDL 2.0.1.
442
477
  */
@@ -494,7 +529,7 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
494
529
  *
495
530
  * \since This function is available since SDL 2.0.10.
496
531
  *
497
- * \sa SDL_SIMDAlignment
532
+ * \sa SDL_SIMDGetAlignment
498
533
  * \sa SDL_SIMDRealloc
499
534
  * \sa SDL_SIMDFree
500
535
  */
@@ -518,7 +553,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
518
553
  *
519
554
  * \since This function is available since SDL 2.0.14.
520
555
  *
521
- * \sa SDL_SIMDAlignment
556
+ * \sa SDL_SIMDGetAlignment
522
557
  * \sa SDL_SIMDAlloc
523
558
  * \sa SDL_SIMDFree
524
559
  */
@@ -192,6 +192,20 @@ typedef int64_t khronos_int64_t;
192
192
  typedef uint64_t khronos_uint64_t;
193
193
  #define KHRONOS_SUPPORT_INT64 1
194
194
  #define KHRONOS_SUPPORT_FLOAT 1
195
+ /*
196
+ * To support platform where unsigned long cannot be used interchangeably with
197
+ * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
198
+ * Ideally, we could just use (u)intptr_t everywhere, but this could result in
199
+ * ABI breakage if khronos_uintptr_t is changed from unsigned long to
200
+ * unsigned long long or similar (this results in different C++ name mangling).
201
+ * To avoid changes for existing platforms, we restrict usage of intptr_t to
202
+ * platforms where the size of a pointer is larger than the size of long.
203
+ */
204
+ #if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
205
+ #if __SIZEOF_POINTER__ > __SIZEOF_LONG__
206
+ #define KHRONOS_USE_INTPTR_T
207
+ #endif
208
+ #endif
195
209
 
196
210
  #elif defined(__VMS ) || defined(__sgi)
197
211
 
@@ -274,14 +288,21 @@ typedef unsigned short int khronos_uint16_t;
274
288
  * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
275
289
  * to be the only LLP64 architecture in current use.
276
290
  */
277
- #ifdef _WIN64
291
+ #ifdef KHRONOS_USE_INTPTR_T
292
+ typedef intptr_t khronos_intptr_t;
293
+ typedef uintptr_t khronos_uintptr_t;
294
+ #elif defined(_WIN64)
278
295
  typedef signed long long int khronos_intptr_t;
279
296
  typedef unsigned long long int khronos_uintptr_t;
280
- typedef signed long long int khronos_ssize_t;
281
- typedef unsigned long long int khronos_usize_t;
282
297
  #else
283
298
  typedef signed long int khronos_intptr_t;
284
299
  typedef unsigned long int khronos_uintptr_t;
300
+ #endif
301
+
302
+ #if defined(_WIN64)
303
+ typedef signed long long int khronos_ssize_t;
304
+ typedef unsigned long long int khronos_usize_t;
305
+ #else
285
306
  typedef signed long int khronos_ssize_t;
286
307
  typedef unsigned long int khronos_usize_t;
287
308
  #endif
@@ -516,7 +537,7 @@ extern "C" {
516
537
  ** used to make the header, and the header can be found at
517
538
  ** http://www.khronos.org/registry/egl
518
539
  **
519
- ** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
540
+ ** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
520
541
  */
521
542
 
522
543
  /*#include <EGL/eglplatform.h>*/
@@ -525,7 +546,7 @@ extern "C" {
525
546
  #define EGL_EGL_PROTOTYPES 1
526
547
  #endif
527
548
 
528
- /* Generated on date 20210901 */
549
+ /* Generated on date 20220525 */
529
550
 
530
551
  /* Generated C header for:
531
552
  * API: egl
@@ -860,12 +881,12 @@ extern "C" {
860
881
  ** used to make the header, and the header can be found at
861
882
  ** http://www.khronos.org/registry/egl
862
883
  **
863
- ** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
884
+ ** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
864
885
  */
865
886
 
866
887
  /*#include <EGL/eglplatform.h>*/
867
888
 
868
- #define EGL_EGLEXT_VERSION 20210901
889
+ #define EGL_EGLEXT_VERSION 20220525
869
890
 
870
891
  /* Generated C header for:
871
892
  * API: egl
@@ -1569,6 +1590,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLi
1569
1590
  #define EGL_RENDERER_EXT 0x335F
1570
1591
  #endif /* EGL_EXT_device_query_name */
1571
1592
 
1593
+ #ifndef EGL_EXT_explicit_device
1594
+ #define EGL_EXT_explicit_device 1
1595
+ #endif /* EGL_EXT_explicit_device */
1596
+
1572
1597
  #ifndef EGL_EXT_gl_colorspace_bt2020_linear
1573
1598
  #define EGL_EXT_gl_colorspace_bt2020_linear 1
1574
1599
  #define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
@@ -1794,6 +1819,31 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr
1794
1819
  #define EGL_METADATA_SCALING_EXT 50000
1795
1820
  #endif /* EGL_EXT_surface_SMPTE2086_metadata */
1796
1821
 
1822
+ #ifndef EGL_EXT_surface_compression
1823
+ #define EGL_EXT_surface_compression 1
1824
+ #define EGL_SURFACE_COMPRESSION_EXT 0x34B0
1825
+ #define EGL_SURFACE_COMPRESSION_PLANE1_EXT 0x328E
1826
+ #define EGL_SURFACE_COMPRESSION_PLANE2_EXT 0x328F
1827
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x34B1
1828
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x34B2
1829
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x34B4
1830
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x34B5
1831
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x34B6
1832
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x34B7
1833
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x34B8
1834
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x34B9
1835
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x34BA
1836
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x34BB
1837
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x34BC
1838
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x34BD
1839
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x34BE
1840
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x34BF
1841
+ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXTPROC) (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
1842
+ #ifdef EGL_EGLEXT_PROTOTYPES
1843
+ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySupportedCompressionRatesEXT (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
1844
+ #endif
1845
+ #endif /* EGL_EXT_surface_compression */
1846
+
1797
1847
  #ifndef EGL_EXT_swap_buffers_with_damage
1798
1848
  #define EGL_EXT_swap_buffers_with_damage 1
1799
1849
  typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
@@ -2028,12 +2078,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
2028
2078
  #define EGL_STREAM_IMAGE_ADD_NV 0x3374
2029
2079
  #define EGL_STREAM_IMAGE_REMOVE_NV 0x3375
2030
2080
  #define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376
2031
- typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
2081
+ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
2032
2082
  typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
2033
2083
  typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
2034
2084
  typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
2035
2085
  #ifdef EGL_EGLEXT_PROTOTYPES
2036
- EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
2086
+ EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
2037
2087
  EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
2038
2088
  EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
2039
2089
  EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
@@ -39,7 +39,7 @@
39
39
  static __inline__ void __attribute__((__always_inline__, __nodebug__))
40
40
  _m_prefetch(void *__P)
41
41
  {
42
- __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
42
+ __builtin_prefetch(__P, 0, 3 /* _MM_HINT_T0 */);
43
43
  }
44
44
  #endif /* __PRFCHWINTRIN_H */
45
45
  #endif /* __clang__ */
@@ -59,17 +59,26 @@ _m_prefetch(void *__P)
59
59
  #ifdef __linux__
60
60
  #include <endian.h>
61
61
  #define SDL_BYTEORDER __BYTE_ORDER
62
- #elif defined(__OpenBSD__)
62
+ #elif defined(__OpenBSD__) || defined(__DragonFly__)
63
63
  #include <endian.h>
64
64
  #define SDL_BYTEORDER BYTE_ORDER
65
65
  #elif defined(__FreeBSD__) || defined(__NetBSD__)
66
66
  #include <sys/endian.h>
67
67
  #define SDL_BYTEORDER BYTE_ORDER
68
+ /* predefs from newer gcc and clang versions: */
69
+ #elif defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__BYTE_ORDER__)
70
+ #if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
71
+ #define SDL_BYTEORDER SDL_LIL_ENDIAN
72
+ #elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
73
+ #define SDL_BYTEORDER SDL_BIG_ENDIAN
74
+ #else
75
+ #error Unsupported endianness
76
+ #endif /**/
68
77
  #else
69
78
  #if defined(__hppa__) || \
70
79
  defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
71
80
  (defined(__MIPS__) && defined(__MIPSEB__)) || \
72
- defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
81
+ defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
73
82
  defined(__sparc__)
74
83
  #define SDL_BYTEORDER SDL_BIG_ENDIAN
75
84
  #else
@@ -78,6 +87,28 @@ _m_prefetch(void *__P)
78
87
  #endif /* __linux__ */
79
88
  #endif /* !SDL_BYTEORDER */
80
89
 
90
+ #ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */
91
+ /* predefs from newer gcc versions: */
92
+ #if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__)
93
+ #if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
94
+ #define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
95
+ #elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
96
+ #define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
97
+ #else
98
+ #error Unsupported endianness
99
+ #endif /**/
100
+ #elif defined(__MAVERICK__)
101
+ /* For Maverick, float words are always little-endian. */
102
+ #define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
103
+ #elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__)
104
+ /* For FPA, float words are always big-endian. */
105
+ #define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
106
+ #else
107
+ /* By default, assume that floats words follow the memory system mode. */
108
+ #define SDL_FLOATWORDORDER SDL_BYTEORDER
109
+ #endif /* __FLOAT_WORD_ORDER__ */
110
+ #endif /* !SDL_FLOATWORDORDER */
111
+
81
112
 
82
113
  #include "begin_code.h"
83
114
  /* Set up for C function definitions, even when using C++ */