[vlc-devel] [PATCH 3.0.x] contrib/sdl: fix #25006

Zhao Zhili quinkblack at foxmail.com
Sat Nov 14 11:44:48 CET 2020


error: implicit declaration of function '_dyld_func_lookup' is invalid
in C99 [-Werror,-Wimplicit-function-declaration]
---
 contrib/src/sdl/missing_dyld_func_lookup.diff | 10 ++++++++++
 contrib/src/sdl/rules.mak                     |  1 +
 2 files changed, 11 insertions(+)
 create mode 100644 contrib/src/sdl/missing_dyld_func_lookup.diff

diff --git a/contrib/src/sdl/missing_dyld_func_lookup.diff b/contrib/src/sdl/missing_dyld_func_lookup.diff
new file mode 100644
index 0000000000..a80d0572ad
--- /dev/null
+++ b/contrib/src/sdl/missing_dyld_func_lookup.diff
@@ -0,0 +1,10 @@
+--- sdl/src/loadso/macosx/SDL_dlcompat.c.orig	2020-11-14 15:56:59.000000000 +0800
++++ sdl/src/loadso/macosx/SDL_dlcompat.c	2020-11-14 15:58:25.000000000 +0800
+@@ -161,6 +161,7 @@ static void * SDL_OSX_dlsym(void * dl_re
+ #ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
+ #define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
+ #endif
++extern int _dyld_func_lookup(const char* dyld_func_name, void **address);
+ /* These symbols will be looked for in dyld */
+ static const struct mach_header *(*dyld_NSAddImage) (const char *, unsigned long) = 0;
+ static int (*dyld_NSIsSymbolNameDefinedInImage) (const struct mach_header *, const char *) = 0;
diff --git a/contrib/src/sdl/rules.mak b/contrib/src/sdl/rules.mak
index 4b16cc90f3..ca7020ff49 100644
--- a/contrib/src/sdl/rules.mak
+++ b/contrib/src/sdl/rules.mak
@@ -16,6 +16,7 @@ $(TARBALLS)/SDL-$(SDL_VERSION).tar.gz:
 sdl: SDL-$(SDL_VERSION).tar.gz .sum-sdl
 	$(UNPACK)
 	$(APPLY) $(SRC)/sdl/direct_palette_ref.diff
+	$(APPLY) $(SRC)/sdl/missing_dyld_func_lookup.diff
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 	mv sdl/config.sub sdl/config.guess sdl/build-scripts
-- 
2.28.0



More information about the vlc-devel mailing list