Skip to content

Commit

Permalink
SDL2 for macOS rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Dec 12, 2024
1 parent 4660c64 commit c44400c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 6 deletions.
2 changes: 2 additions & 0 deletions MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ _m_prefetch(void *__P)
#ifndef __MMX__
#define __MMX__
#endif
/*
#ifndef __3dNOW__
#define __3dNOW__
#endif
*/
#endif
#ifndef __SSE__
#define __SSE__
Expand Down
13 changes: 11 additions & 2 deletions MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ _m_prefetch(void *__P)
#ifdef __linux__
#include <endian.h>
#define SDL_BYTEORDER __BYTE_ORDER
#elif defined(__OpenBSD__)
#elif defined(__sun) && defined(__SVR4) /* Solaris */
#include <sys/byteorder.h>
#if defined(_LITTLE_ENDIAN)
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#elif defined(_BIG_ENDIAN)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
#error Unsupported endianness
#endif
#elif defined(__OpenBSD__) || defined(__DragonFly__)
#include <endian.h>
#define SDL_BYTEORDER BYTE_ORDER
#elif defined(__FreeBSD__) || defined(__NetBSD__)
Expand All @@ -79,7 +88,7 @@ _m_prefetch(void *__P)
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MIPSEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
defined(__sparc__)
defined(__sparc__) || defined(__sparc)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
#define SDL_BYTEORDER SDL_LIL_ENDIAN
Expand Down
2 changes: 1 addition & 1 deletion MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define SDL_REVISION "https://github.com/sezero/SDL.git@4217b3c97f36eaf44a9468c66b215e973905839f"
#define SDL_REVISION "https://github.com/sezero/SDL.git@b5fcddf2a00e8fafa25c66db19ce47b23ff11ba7"
#define SDL_REVISION_NUMBER 0
12 changes: 10 additions & 2 deletions MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ typedef uint64_t Uint64;
#ifndef SDL_PRIs64
#if defined(__WIN32__)
#define SDL_PRIs64 "I64d"
#elif defined(PRIs64)
#define SDL_PRIs64 PRIs64
#elif defined(PRId64)
#define SDL_PRIs64 PRId64
#elif defined(__LP64__) && !defined(__APPLE__)
#define SDL_PRIs64 "ld"
#else
Expand Down Expand Up @@ -706,6 +706,14 @@ size_t strlcpy(char* dst, const char* src, size_t size);
size_t strlcat(char* dst, const char* src, size_t size);
#endif

/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
char *strdup(const char *str);

/* Starting LLVM 16, the analyser errors out if these functions do not have
their prototype defined (clang-diagnostic-implicit-function-declaration) */
#include <stdlib.h>
#include <string.h>

#define SDL_malloc malloc
#define SDL_calloc calloc
#define SDL_realloc realloc
Expand Down
4 changes: 4 additions & 0 deletions MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ extern "C" {
VK_DEFINE_HANDLE(VkInstance)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)

/* Make sure to undef to avoid issues in case of later vulkan include */
#undef VK_DEFINE_HANDLE
#undef VK_DEFINE_NON_DISPATCHABLE_HANDLE

#endif /* !NO_SDL_VULKAN_TYPEDEFS */

typedef VkInstance SDL_vulkanInstance;
Expand Down
2 changes: 1 addition & 1 deletion MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
#define SDL_FALLTHROUGH [[fallthrough]]
#else
#if defined(__has_attribute)
#if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC)
#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__)
#else
#define _HAS_FALLTHROUGH 0
Expand Down
Binary file modified MacOSX/SDL2.framework/Versions/A/SDL2
Binary file not shown.

0 comments on commit c44400c

Please sign in to comment.