. fixed a warning under FreeBSD (dlerror() is a const char*, not a char*).

. made configure script look for the bswap assembly instruction (using
   AC_TRY_COMPILE makes sure the compiler will really accept it).
This commit is contained in:
Sam Hocevar 2001-01-09 21:03:47 +00:00
parent 5a88167734
commit ef05e7761e
6 changed files with 187 additions and 156 deletions

301
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,11 @@ dnl Check for compiler environment
AC_C_CONST
AC_C_BIGENDIAN
AC_MSG_CHECKING([whether compiler accepts bswap x86 instruction])
AC_TRY_COMPILE([unsigned int foo( unsigned int x )
{ __asm__("bswap %0" : "=r" (x) : "0" (x)); return x; }],,
AC_DEFINE(HAVE_X86_BSWAP, 1, Define if compiler accepts bswap x86 instruction.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
AC_CHECK_FUNCS(setenv putenv)

View File

@ -192,10 +192,10 @@ typedef struct aout_thread_s
#define AOUT_FMT_U16_LE 0x00000080 /* Little endian U16 */
#define AOUT_FMT_U16_BE 0x00000100 /* Big endian U16 */
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
#elif __BYTE_ORDER == __BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
#define AOUT_FMT_S16_NE AOUT_FMT_S16_BE
#else
#define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
#endif
/*****************************************************************************

View File

@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.21 2001/01/06 07:23:32 sam Exp $
* $Id: common.h,v 1.22 2001/01/09 21:03:47 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
@ -150,16 +150,9 @@ typedef struct video_parser_s * p_video_parser_t;
* byte orders other than little and big endians are not supported, but only
* the VAX seems to have such exotic properties - note that these 'functions'
* needs <netinet/in.h> or the local equivalent. */
/* FIXME??: hton64 should be declared as an extern inline function to avoid border
* effects (see byteorder.h) */
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define hton16 htons
#define hton32 htonl
#define hton64(i) ( ((u64)(htonl((i) & 0xffffffff)) << 32) | htonl(((i) >> 32) & 0xffffffff ) )
#define ntoh16 ntohs
#define ntoh32 ntohl
#define ntoh64 hton64
#elif __BYTE_ORDER == __BIG_ENDIAN
/* FIXME: hton64 should be declared as an extern inline function to avoid
* border effects (see byteorder.h) */
#if WORDS_BIGENDIAN
#define hton16 htons
#define hton32 htonl
#define hton64(i) ( i )
@ -167,7 +160,12 @@ typedef struct video_parser_s * p_video_parser_t;
#define ntoh32 ntohl
#define ntoh64(i) ( i )
#else
/* XXX??: cause a compilation error */
#define hton16 htons
#define hton32 htonl
#define hton64(i) ( ((u64)(htonl((i) & 0xffffffff)) << 32) | htonl(((i) >> 32) & 0xffffffff ) )
#define ntoh16 ntohs
#define ntoh32 ntohl
#define ntoh64 hton64
#endif
/* Macros with automatic casts */

View File

@ -148,6 +148,9 @@
/* Define if you have the threads library (-lthreads). */
#undef HAVE_LIBTHREADS
/* Define if compiler accepts bswap x86 instruction. */
#undef HAVE_X86_BSWAP
/* Define if ntohl is in <sys/param.h>. */
#undef NTOHL_IN_SYS_PARAM_H

View File

@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.7 2000/12/27 18:35:45 massiot Exp $
* $Id: input_ext-dec.h,v 1.8 2001/01/09 21:03:47 sam Exp $
*
* Authors:
*
@ -244,10 +244,10 @@ static __inline__ void DumpBits( bit_stream_t * p_bit_stream, int i_bits )
#if defined(SYS_BEOS)
# define swab32(x) B_BENDIAN_TO_HOST_INT32(x)
#else
# if __BYTE_ORDER == __BIG_ENDIAN
# ifdef WORDS_BIG_ENDIAN
# define swab32(x) (x)
# else
# if defined (__i386__)
# if defined (HAVE_X86_BSWAP)
static __inline__ const u32 __i386_swab32( u32 x )
{
__asm__("bswap %0" : "=r" (x) : "0" (x));