Updated SDL 2.0.16 headers and Mac version of libraries to fix GitHub actions

This commit is contained in:
Tom Kidd 2021-10-02 21:54:26 -05:00
parent bc96500fe6
commit 294eeb3c1c
63 changed files with 1875 additions and 2694 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -40,84 +40,41 @@ extern "C" {
/**
* Set the SDL error message for the current thread.
* \brief Set the error message for the current thread
*
* Calling this function will replace any previous error message that was set.
*
* This function always returns -1, since SDL frequently uses -1 to signify an
* failing result, leading to this idiom:
*
* ```c
* if (error_code) {
* return SDL_SetError("This operation has failed: %d", error_code);
* }
* ```
*
* \param fmt a printf()-style message format string
* \param ... additional parameters matching % tokens in the `fmt` string, if
* any
* \returns always -1.
*
* \sa SDL_ClearError
* \sa SDL_GetError
* \return -1, there is no error handling for this function
*/
extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
/**
* Retrieve a message about the last error that occurred on the current
* thread.
* \brief Get the last error message that was set
*
* It is possible for multiple errors to occur before calling SDL_GetError().
* Only the last error is returned.
* SDL API functions may set error messages and then succeed, so you should
* only use the error value if a function fails.
*
* This returns a pointer to a static buffer for convenience and should not
* be called by multiple threads simultaneously.
*
* The message is only applicable when an SDL function has signaled an error.
* You must check the return values of SDL function calls to determine when to
* appropriately call SDL_GetError(). You should _not_ use the results of
* SDL_GetError() to decide if an error has occurred! Sometimes SDL will set
* an error string even when reporting success.
*
* SDL will _not_ clear the error string for successful API calls. You _must_
* check return values for failure cases before you can assume the error
* string applies.
*
* Error strings are set per-thread, so an error set in a different thread
* will not interfere with the current thread's operation.
*
* The returned string is internally allocated and must not be freed by the
* application.
*
* \returns a message with information about the specific error that occurred,
* or an empty string if there hasn't been an error message set since
* the last call to SDL_ClearError(). The message is only applicable
* when an SDL function has signaled an error. You must check the
* return values of SDL function calls to determine when to
* appropriately call SDL_GetError().
*
* \sa SDL_ClearError
* \sa SDL_SetError
* \return a pointer to the last error message that was set
*/
extern DECLSPEC const char *SDLCALL SDL_GetError(void);
/**
* Get the last error message that was set for the current thread.
* \brief Get the last error message that was set for the current thread
*
* This allows the caller to copy the error string into a provided buffer, but
* otherwise operates exactly the same as SDL_GetError().
* SDL API functions may set error messages and then succeed, so you should
* only use the error value if a function fails.
*
* \param errstr A buffer to fill with the last error message that was set
* for the current thread
* \param maxlen The size of the buffer pointed to by the errstr parameter
*
* \param errstr A buffer to fill with the last error message that was set for
* the current thread
* \param maxlen The size of the buffer pointed to by the errstr parameter
* \returns the pointer passed in as the `errstr` parameter.
*
* \sa SDL_GetError
* \return errstr
*/
extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
/**
* Clear any previous error message for this thread.
*
* \sa SDL_GetError
* \sa SDL_SetError
* \brief Clear the error message for the current thread
*/
extern DECLSPEC void SDLCALL SDL_ClearError(void);