[3PP/MacOS] Fix ffmpeg and sha256 build

ffmpeg: macOS uses "_" symbol prefix (Mach-O), has no <malloc.h>,
and doesn't support .data.rel.ro sections. Add __APPLE__ guards
in ffmpeg-xenia/config.h.

sha256: macOS provides endian macros in <machine/endian.h> instead
of <endian.h>.
This commit is contained in:
Herman S.
2026-03-26 23:13:59 +09:00
parent cf013fdc15
commit 78600212b2
2 changed files with 17 additions and 0 deletions

View File

@@ -9,8 +9,12 @@
// big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
#ifndef _MSC_VER #ifndef _MSC_VER
#ifdef __APPLE__
#include <machine/endian.h>
#else
#include <endian.h> #include <endian.h>
#endif #endif
#endif
namespace sha256 { namespace sha256 {

View File

@@ -11,8 +11,13 @@
#define FFMPEG_LICENSE "LGPL version 2.1 or later" #define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2021 #define CONFIG_THIS_YEAR 2021
#define av_restrict restrict #define av_restrict restrict
#ifdef __APPLE__
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
#else
#define EXTERN_PREFIX "" #define EXTERN_PREFIX ""
#define EXTERN_ASM #define EXTERN_ASM
#endif
#define BUILDSUF "" #define BUILDSUF ""
#define HAVE_MMX2 HAVE_MMXEXT #define HAVE_MMX2 HAVE_MMXEXT
#define SWS_MAX_FILTER_SIZE 256 #define SWS_MAX_FILTER_SIZE 256
@@ -292,7 +297,11 @@
#define HAVE_TERMIOS_H 1 #define HAVE_TERMIOS_H 1
#define HAVE_SEM_TIMEDWAIT 1 #define HAVE_SEM_TIMEDWAIT 1
#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1 #define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#ifdef __APPLE__
#define HAVE_SECTION_DATA_REL_RO 0
#else
#define HAVE_SECTION_DATA_REL_RO 1 #define HAVE_SECTION_DATA_REL_RO 1
#endif
#define HAVE_CLOCK_GETTIME 1 #define HAVE_CLOCK_GETTIME 1
#define HAVE_FCNTL 1 #define HAVE_FCNTL 1
#define HAVE_GETADDRINFO 1 #define HAVE_GETADDRINFO 1
@@ -351,7 +360,11 @@
#define HAVE_THREADS 1 #define HAVE_THREADS 1
#define HAVE_ACCESS 1 #define HAVE_ACCESS 1
#define HAVE_ISATTY 1 #define HAVE_ISATTY 1
#ifdef __APPLE__
#define HAVE_MALLOC_H 0
#else
#define HAVE_MALLOC_H 1 #define HAVE_MALLOC_H 1
#endif
#define HAVE_PRAGMA_DEPRECATED 1 #define HAVE_PRAGMA_DEPRECATED 1
/* Math functions */ /* Math functions */