summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-17 06:11:30 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-17 06:11:30 +0000
commit75fd3688f52f3d9574cf7204fd74c9eb9f2a639b (patch)
tree08ba62ec560e17de7355b18c1b1b79090b4062b3 /src
parent34b5a8c6d29bc613e7c00ba56c2eccdad182af27 (diff)
downloadxine-lib-75fd3688f52f3d9574cf7204fd74c9eb9f2a639b.tar.gz
xine-lib-75fd3688f52f3d9574cf7204fd74c9eb9f2a639b.tar.bz2
Instead of relying on FreeBSD being the only system not having __environ stderr ___brk_addr and __ctype_b, look for them during ./configure stage. Also check for alternatives, and check for compiler's weak aliasing support only if it's actually going to be used.
CVS patchset: 8696 CVS date: 2007/03/17 06:11:30
Diffstat (limited to 'src')
-rw-r--r--src/libreal/real_common.c7
-rw-r--r--src/libreal/real_common.h28
2 files changed, 28 insertions, 7 deletions
diff --git a/src/libreal/real_common.c b/src/libreal/real_common.c
index dbe528ee0..7110198db 100644
--- a/src/libreal/real_common.c
+++ b/src/libreal/real_common.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: real_common.c,v 1.10 2007/03/16 22:49:16 dgp85 Exp $
+ * $Id: real_common.c,v 1.11 2007/03/17 06:11:30 dgp85 Exp $
*
* Common function for the thin layer to use Real binary-only codecs in xine
*/
@@ -62,8 +62,11 @@ void __pure_virtual(void) {
#endif
-#ifdef __FreeBSD__ /* TODO: alias them if at all possible */
+#ifndef HAVE____BRK_ADDR
void ___brk_addr(void) { exit(0); }
+#endif
+
+#ifndef HAVE___CTYPE_B
void __ctype_b(void) { exit(0); }
#endif
diff --git a/src/libreal/real_common.h b/src/libreal/real_common.h
index 86cf4a63f..7fcd1c4fa 100644
--- a/src/libreal/real_common.h
+++ b/src/libreal/real_common.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: real_common.h,v 1.5 2007/03/16 22:46:49 dgp85 Exp $
+ * $Id: real_common.h,v 1.6 2007/03/17 06:11:31 dgp85 Exp $
*
* Common function for the thin layer to use Real binary-only codecs in xine
*/
@@ -44,13 +44,31 @@ void __pure_virtual(void) EXPORTED;
#endif
-#ifdef __FreeBSD__
- #ifdef SUPPORT_ATTRIBUTE_ALIAS
-char **__environ __attribute__((weak, alias("environ")));
+#ifndef HAVE___ENVIRON
+# ifdef HAVE__ENVIRON
+ char **__environ __attribute__((weak, alias("_environ")));
+# elif defined(HAVE_ENVIRON)
+ char **__environ __attribute__((weak, alias("environ")));
+# else
+ char **fake__environ = { NULL };
+ char **__environ __attribute__((weak, alias("fake__environ")));
+# endif
+#endif
+
+#ifndef HAVE_STDERR
+# ifdef HAVE___STDERRP
+# undef stderr
FILE *stderr __attribute__((weak, alias("__stderrp")));
+# else
+# error Your stderr alias is not supported, please report to xine developers.
+# endif
+#endif
- #endif
+#ifndef HAVE____BRK_ADDR
void ___brk_addr(void) EXPORTED;
+#endif
+
+#ifndef HAVE___CTYPE_B
void __ctype_b(void) EXPORTED;
#endif