Skip to content

Commit

Permalink
Update vendored SDL3 headers to version 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hazeycode committed Jan 28, 2025
1 parent 0775d0f commit d174c51
Show file tree
Hide file tree
Showing 63 changed files with 2,374 additions and 2,116 deletions.
2 changes: 1 addition & 1 deletion libs/sdl3/include/SDL3/SDL.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

/**
* Main include header for the SDL library, version 3.1.10
* Main include header for the SDL library, version 3.2.0
*
* It is almost always best to include just this one header instead of
* picking out individual headers included here. There are exceptions to
Expand Down
46 changes: 24 additions & 22 deletions libs/sdl3/include/SDL3/SDL_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extern "C" {
* - 3: Paranoid settings: All SDL assertion macros enabled, including
* SDL_assert_paranoid.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_ASSERT_LEVEL SomeNumberBasedOnVariousFactors

Expand Down Expand Up @@ -122,7 +122,7 @@ extern "C" {
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner

Expand All @@ -137,6 +137,8 @@ extern "C" {
#define SDL_TriggerBreakpoint() assert(0)
#elif SDL_HAS_BUILTIN(__builtin_debugtrap)
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
#elif SDL_HAS_BUILTIN(__builtin_trap)
#define SDL_TriggerBreakpoint() __builtin_trap()
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
Expand All @@ -163,7 +165,7 @@ extern "C" {
*
* If SDL can't figure how the compiler reports this, it will use "???".
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_FUNCTION __FUNCTION__

Expand All @@ -178,14 +180,14 @@ extern "C" {
/**
* A macro that reports the current file being compiled.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_FILE __FILE__

/**
* A macro that reports the current line number of the file being compiled.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_LINE __LINE__

Expand Down Expand Up @@ -222,7 +224,7 @@ disable assertions.
* do { SomethingOnce(); } while (SDL_NULL_WHILE_LOOP_CONDITION (0));
* ```
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_NULL_WHILE_LOOP_CONDITION (0)

Expand All @@ -246,7 +248,7 @@ disable assertions.
*
* \param condition the condition to assert (but not actually run here).
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_disabled_assert(condition) \
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
Expand All @@ -262,7 +264,7 @@ disable assertions.
* condition, try to break in a debugger, kill the program, or ignore the
* problem).
*
* \since This enum is available since SDL 3.1.3.
* \since This enum is available since SDL 3.2.0.
*/
typedef enum SDL_AssertState
{
Expand All @@ -280,7 +282,7 @@ typedef enum SDL_AssertState
* used by the assertion handler, then added to the assertion report. This is
* returned as a linked list from SDL_GetAssertionReport().
*
* \since This struct is available since SDL 3.1.3.
* \since This struct is available since SDL 3.2.0.
*/
typedef struct SDL_AssertData
{
Expand All @@ -306,7 +308,7 @@ typedef struct SDL_AssertData
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.3.
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
const char *func,
Expand All @@ -321,7 +323,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
* This isn't for direct use by apps; use SDL_assert or SDL_TriggerBreakpoint
* instead.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()

Expand Down Expand Up @@ -353,7 +355,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
*
* \param condition the condition to assert.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_enabled_assert(condition) \
do { \
Expand Down Expand Up @@ -399,7 +401,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_assert(condition) if (assertion_enabled && (condition)) { trigger_assertion; }

Expand Down Expand Up @@ -432,7 +434,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_assert_release(condition) SDL_disabled_assert(condition)

Expand Down Expand Up @@ -461,7 +463,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)

Expand Down Expand Up @@ -505,7 +507,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.1.3.
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_assert_always(condition) SDL_enabled_assert(condition)

Expand All @@ -521,7 +523,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *
* \threadsafety This callback may be called from any thread that triggers an
* assert at any time.
*
* \since This datatype is available since SDL 3.1.3.
* \since This datatype is available since SDL 3.2.0.
*/
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
const SDL_AssertData *data, void *userdata);
Expand All @@ -545,7 +547,7 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.3.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAssertionHandler
*/
Expand All @@ -566,7 +568,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler(
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.3.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAssertionHandler
*/
Expand All @@ -591,7 +593,7 @@ extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.3.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAssertionHandler
*/
Expand Down Expand Up @@ -625,7 +627,7 @@ extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **
* SDL_ResetAssertionReport() simultaneously, may render the
* returned pointer invalid.
*
* \since This function is available since SDL 3.1.3.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ResetAssertionReport
*/
Expand All @@ -643,7 +645,7 @@ extern SDL_DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
* assertion, or simultaneously calling this function may cause
* memory leaks or crashes.
*
* \since This function is available since SDL 3.1.3.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetAssertionReport
*/
Expand Down
22 changes: 11 additions & 11 deletions libs/sdl3/include/SDL3/SDL_asyncio.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ typedef struct SDL_AsyncIOQueue SDL_AsyncIOQueue;
* \returns a pointer to the SDL_AsyncIO structure that is created or NULL on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CloseAsyncIO
* \sa SDL_ReadAsyncIO
Expand All @@ -234,7 +234,7 @@ extern SDL_DECLSPEC SDL_AsyncIO * SDLCALL SDL_AsyncIOFromFile(const char *file,
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetAsyncIOSize(SDL_AsyncIO *asyncio);

Expand Down Expand Up @@ -269,7 +269,7 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetAsyncIOSize(SDL_AsyncIO *asyncio);
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_WriteAsyncIO
* \sa SDL_CreateAsyncIOQueue
Expand Down Expand Up @@ -306,7 +306,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadAsyncIO(SDL_AsyncIO *asyncio, void *ptr
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ReadAsyncIO
* \sa SDL_CreateAsyncIOQueue
Expand Down Expand Up @@ -358,7 +358,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WriteAsyncIO(SDL_AsyncIO *asyncio, void *pt
* \threadsafety It is safe to call this function from any thread, but two
* threads should not attempt to close the same object.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_CloseAsyncIO(SDL_AsyncIO *asyncio, bool flush, SDL_AsyncIOQueue *queue, void *userdata);

Expand All @@ -373,7 +373,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_CloseAsyncIO(SDL_AsyncIO *asyncio, bool flu
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_DestroyAsyncIOQueue
* \sa SDL_GetAsyncIOResult
Expand Down Expand Up @@ -407,7 +407,7 @@ extern SDL_DECLSPEC SDL_AsyncIOQueue * SDLCALL SDL_CreateAsyncIOQueue(void);
* no other thread is waiting on the queue with
* SDL_WaitAsyncIOResult.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC void SDLCALL SDL_DestroyAsyncIOQueue(SDL_AsyncIOQueue *queue);

Expand All @@ -431,7 +431,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAsyncIOQueue(SDL_AsyncIOQueue *queue
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_WaitAsyncIOResult
*/
Expand Down Expand Up @@ -475,7 +475,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetAsyncIOResult(SDL_AsyncIOQueue *queue, S
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SignalAsyncIOQueue
*/
Expand All @@ -499,7 +499,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitAsyncIOResult(SDL_AsyncIOQueue *queue,
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_WaitAsyncIOResult
*/
Expand Down Expand Up @@ -531,7 +531,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SignalAsyncIOQueue(SDL_AsyncIOQueue *queue)
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.1.8.
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LoadFile_IO
*/
Expand Down
Loading

0 comments on commit d174c51

Please sign in to comment.