Commit ef05e776 authored by Sam Hocevar's avatar Sam Hocevar

 . 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).
parent 5a881677
This diff is collapsed.
...@@ -25,6 +25,11 @@ dnl Check for compiler environment ...@@ -25,6 +25,11 @@ dnl Check for compiler environment
AC_C_CONST AC_C_CONST
AC_C_BIGENDIAN 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 dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol) AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
AC_CHECK_FUNCS(setenv putenv) AC_CHECK_FUNCS(setenv putenv)
......
...@@ -192,10 +192,10 @@ typedef struct aout_thread_s ...@@ -192,10 +192,10 @@ typedef struct aout_thread_s
#define AOUT_FMT_U16_LE 0x00000080 /* Little endian U16 */ #define AOUT_FMT_U16_LE 0x00000080 /* Little endian U16 */
#define AOUT_FMT_U16_BE 0x00000100 /* Big endian U16 */ #define AOUT_FMT_U16_BE 0x00000100 /* Big endian U16 */
#if __BYTE_ORDER == __LITTLE_ENDIAN #ifdef WORDS_BIGENDIAN
#define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
#elif __BYTE_ORDER == __BIG_ENDIAN
#define AOUT_FMT_S16_NE AOUT_FMT_S16_BE #define AOUT_FMT_S16_NE AOUT_FMT_S16_BE
#else
#define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
#endif #endif
/***************************************************************************** /*****************************************************************************
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * 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> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -150,24 +150,22 @@ typedef struct video_parser_s * p_video_parser_t; ...@@ -150,24 +150,22 @@ typedef struct video_parser_s * p_video_parser_t;
* byte orders other than little and big endians are not supported, but only * 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' * the VAX seems to have such exotic properties - note that these 'functions'
* needs <netinet/in.h> or the local equivalent. */ * needs <netinet/in.h> or the local equivalent. */
/* FIXME??: hton64 should be declared as an extern inline function to avoid border /* FIXME: hton64 should be declared as an extern inline function to avoid
* effects (see byteorder.h) */ * border effects (see byteorder.h) */
#if __BYTE_ORDER == __LITTLE_ENDIAN #if WORDS_BIGENDIAN
#define hton16 htons #define hton16 htons
#define hton32 htonl #define hton32 htonl
#define hton64(i) ( ((u64)(htonl((i) & 0xffffffff)) << 32) | htonl(((i) >> 32) & 0xffffffff ) ) #define hton64(i) ( i )
#define ntoh16 ntohs #define ntoh16 ntohs
#define ntoh32 ntohl #define ntoh32 ntohl
#define ntoh64 hton64 #define ntoh64(i) ( i )
#elif __BYTE_ORDER == __BIG_ENDIAN #else
#define hton16 htons #define hton16 htons
#define hton32 htonl #define hton32 htonl
#define hton64(i) ( i ) #define hton64(i) ( ((u64)(htonl((i) & 0xffffffff)) << 32) | htonl(((i) >> 32) & 0xffffffff ) )
#define ntoh16 ntohs #define ntoh16 ntohs
#define ntoh32 ntohl #define ntoh32 ntohl
#define ntoh64(i) ( i ) #define ntoh64 hton64
#else
/* XXX??: cause a compilation error */
#endif #endif
/* Macros with automatic casts */ /* Macros with automatic casts */
......
...@@ -148,6 +148,9 @@ ...@@ -148,6 +148,9 @@
/* Define if you have the threads library (-lthreads). */ /* Define if you have the threads library (-lthreads). */
#undef HAVE_LIBTHREADS #undef HAVE_LIBTHREADS
/* Define if compiler accepts bswap x86 instruction. */
#undef HAVE_X86_BSWAP
/* Define if ntohl is in <sys/param.h>. */ /* Define if ntohl is in <sys/param.h>. */
#undef NTOHL_IN_SYS_PARAM_H #undef NTOHL_IN_SYS_PARAM_H
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders * input_ext-dec.h: structures exported to the VideoLAN decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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: * Authors:
* *
...@@ -244,10 +244,10 @@ static __inline__ void DumpBits( bit_stream_t * p_bit_stream, int i_bits ) ...@@ -244,10 +244,10 @@ static __inline__ void DumpBits( bit_stream_t * p_bit_stream, int i_bits )
#if defined(SYS_BEOS) #if defined(SYS_BEOS)
# define swab32(x) B_BENDIAN_TO_HOST_INT32(x) # define swab32(x) B_BENDIAN_TO_HOST_INT32(x)
#else #else
# if __BYTE_ORDER == __BIG_ENDIAN # ifdef WORDS_BIG_ENDIAN
# define swab32(x) (x) # define swab32(x) (x)
# else # else
# if defined (__i386__) # if defined (HAVE_X86_BSWAP)
static __inline__ const u32 __i386_swab32( u32 x ) static __inline__ const u32 __i386_swab32( u32 x )
{ {
__asm__("bswap %0" : "=r" (x) : "0" (x)); __asm__("bswap %0" : "=r" (x) : "0" (x));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment