From 75fd3688f52f3d9574cf7204fd74c9eb9f2a639b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 17 Mar 2007 06:11:30 +0000 Subject: 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 --- src/libreal/real_common.c | 7 +++++-- src/libreal/real_common.h | 28 +++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 7 deletions(-) (limited to 'src') 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 -- cgit v1.2.3