Skip to content

Commit bf0f4ef

Browse files
committed
bsp/simulator: update SDL2 Windows prebuilt binaries to 2.32.6 with x86 and x64 binaries
1 parent 1635fb4 commit bf0f4ef

File tree

105 files changed

+15139
-8116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+15139
-8116
lines changed

bsp/simulator/SDL2/include/SDL.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
3+
Copyright (C) 1997-2025 Sam Lantinga <[email protected]>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -25,7 +25,6 @@
2525
* Main include header for the SDL library
2626
*/
2727

28-
2928
#ifndef SDL_h_
3029
#define SDL_h_
3130

@@ -41,6 +40,7 @@
4140
#include "SDL_events.h"
4241
#include "SDL_filesystem.h"
4342
#include "SDL_gamecontroller.h"
43+
#include "SDL_guid.h"
4444
#include "SDL_haptic.h"
4545
#include "SDL_hidapi.h"
4646
#include "SDL_hints.h"
@@ -69,6 +69,8 @@
6969
extern "C" {
7070
#endif
7171

72+
/* WIKI CATEGORY: Init */
73+
7274
/* As of version 0.5, SDL is loaded dynamically into the application */
7375

7476
/**
@@ -129,7 +131,7 @@ extern "C" {
129131
* call SDL_Quit() to force shutdown). If a subsystem is already loaded then
130132
* this call will increase the ref-count and return.
131133
*
132-
* \param flags subsystem initialization flags
134+
* \param flags subsystem initialization flags.
133135
* \returns 0 on success or a negative error code on failure; call
134136
* SDL_GetError() for more information.
135137
*

bsp/simulator/SDL2/include/SDL_assert.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
3+
Copyright (C) 1997-2025 Sam Lantinga <[email protected]>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -22,7 +22,7 @@
2222
#ifndef SDL_assert_h_
2323
#define SDL_assert_h_
2424

25-
#include "SDL_config.h"
25+
#include "SDL_stdinc.h"
2626

2727
#include "begin_code.h"
2828
/* Set up for C function definitions, even when using C++ */
@@ -51,12 +51,18 @@ assert can have unique static variables associated with it.
5151
/* Don't include intrin.h here because it contains C++ code */
5252
extern void __cdecl __debugbreak(void);
5353
#define SDL_TriggerBreakpoint() __debugbreak()
54+
#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
55+
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
5456
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
5557
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
58+
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
59+
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
5660
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
5761
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
5862
#elif defined(__APPLE__) && defined(__arm__)
5963
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
64+
#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
65+
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
6066
#elif defined(__386__) && defined(__WATCOMC__)
6167
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
6268
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
@@ -69,7 +75,7 @@ assert can have unique static variables associated with it.
6975

7076
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
7177
# define SDL_FUNCTION __func__
72-
#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
78+
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
7379
# define SDL_FUNCTION __FUNCTION__
7480
#else
7581
# define SDL_FUNCTION "???"
@@ -123,12 +129,10 @@ typedef struct SDL_AssertData
123129
const struct SDL_AssertData *next;
124130
} SDL_AssertData;
125131

126-
#if (SDL_ASSERT_LEVEL > 0)
127-
128132
/* Never call this directly. Use the SDL_assert* macros. */
129133
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
130-
const char *,
131-
const char *, int)
134+
const char *,
135+
const char *, int)
132136
#if defined(__clang__)
133137
#if __has_feature(attribute_analyzer_noreturn)
134138
/* this tells Clang's static analysis that we're a custom assert function,
@@ -149,9 +153,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
149153
#define SDL_enabled_assert(condition) \
150154
do { \
151155
while ( !(condition) ) { \
152-
static struct SDL_AssertData sdl_assert_data = { \
153-
0, 0, #condition, 0, 0, 0, 0 \
154-
}; \
156+
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
155157
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
156158
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
157159
continue; /* go again. */ \
@@ -162,8 +164,6 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
162164
} \
163165
} while (SDL_NULL_WHILE_LOOP_CONDITION)
164166

165-
#endif /* enabled assertions support code */
166-
167167
/* Enable various levels of assertions. */
168168
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
169169
# define SDL_assert(condition) SDL_disabled_assert(condition)
@@ -193,8 +193,8 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
193193
* A callback that fires when an SDL assertion fails.
194194
*
195195
* \param data a pointer to the SDL_AssertData structure corresponding to the
196-
* current assertion
197-
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
196+
* current assertion.
197+
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
198198
* \returns an SDL_AssertState value indicating how to handle the failure.
199199
*/
200200
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
@@ -214,8 +214,8 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
214214
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
215215
*
216216
* \param handler the SDL_AssertionHandler function to call when an assertion
217-
* fails or NULL for the default handler
218-
* \param userdata a pointer that is passed to `handler`
217+
* fails or NULL for the default handler.
218+
* \param userdata a pointer that is passed to `handler`.
219219
*
220220
* \since This function is available since SDL 2.0.0.
221221
*
@@ -256,7 +256,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void
256256
* data, it is safe to pass a NULL pointer to this function to ignore it.
257257
*
258258
* \param puserdata pointer which is filled with the "userdata" pointer that
259-
* was passed to SDL_SetAssertionHandler()
259+
* was passed to SDL_SetAssertionHandler().
260260
* \returns the SDL_AssertionHandler that is called when an assert triggers.
261261
*
262262
* \since This function is available since SDL 2.0.2.

bsp/simulator/SDL2/include/SDL_atomic.h

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Simple DirectMedia Layer
3-
Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
3+
Copyright (C) 1997-2025 Sam Lantinga <[email protected]>
44
55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages
@@ -20,38 +20,29 @@
2020
*/
2121

2222
/**
23-
* \file SDL_atomic.h
23+
* # CategoryAtomic
2424
*
2525
* Atomic operations.
2626
*
27-
* IMPORTANT:
28-
* If you are not an expert in concurrent lockless programming, you should
29-
* only be using the atomic lock and reference counting functions in this
30-
* file. In all other cases you should be protecting your data structures
31-
* with full mutexes.
27+
* IMPORTANT: If you are not an expert in concurrent lockless programming, you
28+
* should not be using any functions in this file. You should be protecting
29+
* your data structures with full mutexes instead.
3230
*
33-
* The list of "safe" functions to use are:
34-
* SDL_AtomicLock()
35-
* SDL_AtomicUnlock()
36-
* SDL_AtomicIncRef()
37-
* SDL_AtomicDecRef()
31+
* ***Seriously, here be dragons!***
3832
*
39-
* Seriously, here be dragons!
40-
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
41-
*
42-
* You can find out a little more about lockless programming and the
43-
* subtle issues that can arise here:
44-
* http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
33+
* You can find out a little more about lockless programming and the subtle
34+
* issues that can arise here:
35+
* https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming
4536
*
4637
* There's also lots of good information here:
47-
* http://www.1024cores.net/home/lock-free-algorithms
48-
* http://preshing.com/
4938
*
50-
* These operations may or may not actually be implemented using
51-
* processor specific atomic operations. When possible they are
52-
* implemented as true processor specific atomic operations. When that
53-
* is not possible the are implemented using locks that *do* use the
54-
* available atomic operations.
39+
* - https://www.1024cores.net/home/lock-free-algorithms
40+
* - https://preshing.com/
41+
*
42+
* These operations may or may not actually be implemented using processor
43+
* specific atomic operations. When possible they are implemented as true
44+
* processor specific atomic operations. When that is not possible the are
45+
* implemented using locks that *do* use the available atomic operations.
5546
*
5647
* All of the atomic operations that modify memory are full memory barriers.
5748
*/
@@ -94,7 +85,7 @@ typedef int SDL_SpinLock;
9485
* ***Please note that spinlocks are dangerous if you don't know what you're
9586
* doing. Please be careful using any sort of spinlock!***
9687
*
97-
* \param lock a pointer to a lock variable
88+
* \param lock a pointer to a lock variable.
9889
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
9990
* held.
10091
*
@@ -111,7 +102,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
111102
* ***Please note that spinlocks are dangerous if you don't know what you're
112103
* doing. Please be careful using any sort of spinlock!***
113104
*
114-
* \param lock a pointer to a lock variable
105+
* \param lock a pointer to a lock variable.
115106
*
116107
* \since This function is available since SDL 2.0.0.
117108
*
@@ -128,7 +119,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
128119
* ***Please note that spinlocks are dangerous if you don't know what you're
129120
* doing. Please be careful using any sort of spinlock!***
130121
*
131-
* \param lock a pointer to a lock variable
122+
* \param lock a pointer to a lock variable.
132123
*
133124
* \since This function is available since SDL 2.0.0.
134125
*
@@ -198,8 +189,8 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
198189
hard-coded at address 0xffff0fa0
199190
*/
200191
typedef void (*SDL_KernelMemoryBarrierFunc)();
201-
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
202-
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
192+
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
193+
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
203194
#elif 0 /* defined(__QNXNTO__) */
204195
#include <sys/cpuinline.h>
205196

@@ -209,7 +200,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
209200
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
210201
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
211202
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
212-
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
203+
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
213204
#ifdef __thumb__
214205
/* The mcr instruction isn't available in thumb mode, use real functions */
215206
#define SDL_MEMORY_BARRIER_USES_FUNCTION
@@ -237,21 +228,43 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
237228
#endif
238229
#endif
239230

231+
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
232+
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
233+
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
234+
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
235+
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
236+
#elif (defined(__powerpc__) || defined(__powerpc64__))
237+
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
238+
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
239+
#define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
240+
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
241+
#define SDL_CPUPauseInstruction() __yield()
242+
#elif defined(__WATCOMC__) && defined(__386__)
243+
extern __inline void SDL_CPUPauseInstruction(void);
244+
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
245+
#else
246+
#define SDL_CPUPauseInstruction()
247+
#endif
248+
249+
240250
/**
241-
* \brief A type representing an atomic integer value. It is a struct
242-
* so people don't accidentally use numeric operations on it.
251+
* A type representing an atomic integer value.
252+
*
253+
* It is a struct so people don't accidentally use numeric operations on it.
243254
*/
244-
typedef struct { int value; } SDL_atomic_t;
255+
typedef struct SDL_atomic_t {
256+
int value;
257+
} SDL_atomic_t;
245258

246259
/**
247260
* Set an atomic variable to a new value if it is currently an old value.
248261
*
249262
* ***Note: If you don't know what this function is for, you shouldn't use
250263
* it!***
251264
*
252-
* \param a a pointer to an SDL_atomic_t variable to be modified
253-
* \param oldval the old value
254-
* \param newval the new value
265+
* \param a a pointer to an SDL_atomic_t variable to be modified.
266+
* \param oldval the old value.
267+
* \param newval the new value.
255268
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
256269
*
257270
* \since This function is available since SDL 2.0.0.
@@ -270,8 +283,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int
270283
* ***Note: If you don't know what this function is for, you shouldn't use
271284
* it!***
272285
*
273-
* \param a a pointer to an SDL_atomic_t variable to be modified
274-
* \param v the desired value
286+
* \param a a pointer to an SDL_atomic_t variable to be modified.
287+
* \param v the desired value.
275288
* \returns the previous value of the atomic variable.
276289
*
277290
* \since This function is available since SDL 2.0.2.
@@ -286,7 +299,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
286299
* ***Note: If you don't know what this function is for, you shouldn't use
287300
* it!***
288301
*
289-
* \param a a pointer to an SDL_atomic_t variable
302+
* \param a a pointer to an SDL_atomic_t variable.
290303
* \returns the current value of an atomic variable.
291304
*
292305
* \since This function is available since SDL 2.0.2.
@@ -303,8 +316,8 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
303316
* ***Note: If you don't know what this function is for, you shouldn't use
304317
* it!***
305318
*
306-
* \param a a pointer to an SDL_atomic_t variable to be modified
307-
* \param v the desired value to add
319+
* \param a a pointer to an SDL_atomic_t variable to be modified.
320+
* \param v the desired value to add.
308321
* \returns the previous value of the atomic variable.
309322
*
310323
* \since This function is available since SDL 2.0.2.
@@ -337,9 +350,9 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
337350
* ***Note: If you don't know what this function is for, you shouldn't use
338351
* it!***
339352
*
340-
* \param a a pointer to a pointer
341-
* \param oldval the old pointer value
342-
* \param newval the new pointer value
353+
* \param a a pointer to a pointer.
354+
* \param oldval the old pointer value.
355+
* \param newval the new pointer value.
343356
* \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
344357
*
345358
* \since This function is available since SDL 2.0.0.
@@ -356,8 +369,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *
356369
* ***Note: If you don't know what this function is for, you shouldn't use
357370
* it!***
358371
*
359-
* \param a a pointer to a pointer
360-
* \param v the desired pointer value
372+
* \param a a pointer to a pointer.
373+
* \param v the desired pointer value.
361374
* \returns the previous value of the pointer.
362375
*
363376
* \since This function is available since SDL 2.0.2.
@@ -373,7 +386,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
373386
* ***Note: If you don't know what this function is for, you shouldn't use
374387
* it!***
375388
*
376-
* \param a a pointer to a pointer
389+
* \param a a pointer to a pointer.
377390
* \returns the current value of a pointer.
378391
*
379392
* \since This function is available since SDL 2.0.2.

0 commit comments

Comments
 (0)