expose a hidden function that prevented linking on osx 10.4 when compiling physfs statically 0.9.19
authorkoda
Sat, 20 Apr 2013 20:39:01 +0200
branch0.9.19
changeset 8928 10a79d89ca31
parent 8927 3da5182d8682
child 8929 499243eb04d1
expose a hidden function that prevented linking on osx 10.4 when compiling physfs statically
misc/libphysfs/platform_macosx.c
--- a/misc/libphysfs/platform_macosx.c	Sat Apr 20 20:13:23 2013 +0200
+++ b/misc/libphysfs/platform_macosx.c	Sat Apr 20 20:39:01 2013 +0200
@@ -29,6 +29,25 @@
 #include "physfs_internal.h"
 
 
+#if defined(__APPLE__)
+#if defined(TARGET_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+/* __eprintf shouldn't have been made visible from libstdc++, or anywhere, but
+   on Mac OS X 10.4 it was defined in libstdc++.6.0.3.dylib; so on that platform
+   we have to keep defining it to keep binary compatibility.
+   We can't just put the libgcc version in the export list, because that
+   doesn't work; once a symbol is marked as hidden, it stays that way.  */
+
+void __eprintf (const char *string, const char *expression,
+	        unsigned int line, const char *filename)
+{
+    fprintf(stderr, string, expression, line, filename);
+    fflush(stderr);
+    abort();
+}
+#endif
+#endif /* __APPLE__ */
+
+
 /* Wrap PHYSFS_Allocator in a CFAllocator... */
 static CFAllocatorRef cfallocator = NULL;