mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
updated SDL2-2.0.22 builds with several backports from SDL2 main branch.
This commit is contained in:
parent
0dd1c12dd9
commit
74f1621e0f
17 changed files with 66 additions and 18 deletions
|
@ -22,7 +22,7 @@
|
|||
#ifndef SDL_assert_h_
|
||||
#define SDL_assert_h_
|
||||
|
||||
#include "SDL_config.h"
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
|
@ -51,6 +51,8 @@ assert can have unique static variables associated with it.
|
|||
/* Don't include intrin.h here because it contains C++ code */
|
||||
extern void __cdecl __debugbreak(void);
|
||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||
#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
|
||||
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
||||
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
||||
|
|
|
@ -87,6 +87,28 @@ _m_prefetch(void *__P)
|
|||
#endif /* __linux__ */
|
||||
#endif /* !SDL_BYTEORDER */
|
||||
|
||||
#ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */
|
||||
/* predefs from newer gcc versions: */
|
||||
#if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__)
|
||||
#if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
|
||||
#elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#error Unsupported endianness
|
||||
#endif /**/
|
||||
#elif defined(__MAVERICK__)
|
||||
/* For Maverick, float words are always little-endian. */
|
||||
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
|
||||
#elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__)
|
||||
/* For FPA, float words are always big-endian. */
|
||||
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
/* By default, assume that floats words follow the memory system mode. */
|
||||
#define SDL_FLOATWORDORDER SDL_BYTEORDER
|
||||
#endif /* __FLOAT_WORD_ORDER__ */
|
||||
#endif /* !SDL_FLOATWORDORDER */
|
||||
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
|
|
|
@ -252,10 +252,10 @@ SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r)
|
|||
SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
|
||||
{
|
||||
return (a && b && ((a == b) ||
|
||||
((SDL_fabs(a->x - b->x) <= epsilon) &&
|
||||
(SDL_fabs(a->y - b->y) <= epsilon) &&
|
||||
(SDL_fabs(a->w - b->w) <= epsilon) &&
|
||||
(SDL_fabs(a->h - b->h) <= epsilon))))
|
||||
((SDL_fabsf(a->x - b->x) <= epsilon) &&
|
||||
(SDL_fabsf(a->y - b->y) <= epsilon) &&
|
||||
(SDL_fabsf(a->w - b->w) <= epsilon) &&
|
||||
(SDL_fabsf(a->h - b->h) <= epsilon))))
|
||||
? SDL_TRUE : SDL_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#define SDL_REVISION "https://github.com/libsdl-org/SDL.git@981e1e3c4489add5bf6d4df5415af3cf1ef2773d"
|
||||
#define SDL_REVISION "@56c8381b400ec81732095e429649ce5e74f8cb28"
|
||||
#define SDL_REVISION_NUMBER 0
|
||||
|
|
|
@ -462,7 +462,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
|||
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
||||
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
||||
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
|
|||
*
|
||||
* \sa SDL_iPhoneSetEventPump
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam);
|
||||
|
||||
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
|||
pfnSDL_CurrentEndThread pfnEndThread);
|
||||
|
||||
extern DECLSPEC SDL_Thread *SDLCALL
|
||||
SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
|
||||
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
|
||||
const char *name, const size_t stacksize, void *data,
|
||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
||||
pfnSDL_CurrentEndThread pfnEndThread);
|
||||
|
|
Binary file not shown.
|
@ -22,7 +22,7 @@
|
|||
#ifndef SDL_assert_h_
|
||||
#define SDL_assert_h_
|
||||
|
||||
#include "SDL_config.h"
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
|
@ -51,6 +51,8 @@ assert can have unique static variables associated with it.
|
|||
/* Don't include intrin.h here because it contains C++ code */
|
||||
extern void __cdecl __debugbreak(void);
|
||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||
#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
|
||||
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
||||
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
||||
|
|
|
@ -87,6 +87,28 @@ _m_prefetch(void *__P)
|
|||
#endif /* __linux__ */
|
||||
#endif /* !SDL_BYTEORDER */
|
||||
|
||||
#ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */
|
||||
/* predefs from newer gcc versions: */
|
||||
#if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__)
|
||||
#if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
|
||||
#elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#error Unsupported endianness
|
||||
#endif /**/
|
||||
#elif defined(__MAVERICK__)
|
||||
/* For Maverick, float words are always little-endian. */
|
||||
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
|
||||
#elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__)
|
||||
/* For FPA, float words are always big-endian. */
|
||||
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
/* By default, assume that floats words follow the memory system mode. */
|
||||
#define SDL_FLOATWORDORDER SDL_BYTEORDER
|
||||
#endif /* __FLOAT_WORD_ORDER__ */
|
||||
#endif /* !SDL_FLOATWORDORDER */
|
||||
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
|
|
|
@ -252,10 +252,10 @@ SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r)
|
|||
SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
|
||||
{
|
||||
return (a && b && ((a == b) ||
|
||||
((SDL_fabs(a->x - b->x) <= epsilon) &&
|
||||
(SDL_fabs(a->y - b->y) <= epsilon) &&
|
||||
(SDL_fabs(a->w - b->w) <= epsilon) &&
|
||||
(SDL_fabs(a->h - b->h) <= epsilon))))
|
||||
((SDL_fabsf(a->x - b->x) <= epsilon) &&
|
||||
(SDL_fabsf(a->y - b->y) <= epsilon) &&
|
||||
(SDL_fabsf(a->w - b->w) <= epsilon) &&
|
||||
(SDL_fabsf(a->h - b->h) <= epsilon))))
|
||||
? SDL_TRUE : SDL_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#define SDL_REVISION "https://github.com/libsdl-org/SDL.git@981e1e3c4489add5bf6d4df5415af3cf1ef2773d"
|
||||
#define SDL_REVISION "@56c8381b400ec81732095e429649ce5e74f8cb28"
|
||||
#define SDL_REVISION_NUMBER 0
|
||||
|
|
|
@ -462,7 +462,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
|||
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
||||
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
||||
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
|
|||
*
|
||||
* \sa SDL_iPhoneSetEventPump
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam);
|
||||
|
||||
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
|||
pfnSDL_CurrentEndThread pfnEndThread);
|
||||
|
||||
extern DECLSPEC SDL_Thread *SDLCALL
|
||||
SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
|
||||
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
|
||||
const char *name, const size_t stacksize, void *data,
|
||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
||||
pfnSDL_CurrentEndThread pfnEndThread);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue