Use AC_CHECK_DECLS in configure.ac to determine if the constant bswap

functions are defined/declared and define them to the non-constant ones
in endians.h if not.

(Logical change 1.314)
edge.strict_endians
cantab.net!aia21 2004-03-10 10:22:03 +00:00
parent aa0398ea0e
commit 0dd38ddd7d
2 changed files with 15 additions and 3 deletions

View File

@ -6,6 +6,18 @@
/* Define to 1 if you have the <byteswap.h> header file. */
#undef HAVE_BYTESWAP_H
/* Define to 1 if you have the declaration of `__bswap_constant_16', and to 0
if you don't. */
#undef HAVE_DECL___BSWAP_CONSTANT_16
/* Define to 1 if you have the declaration of `__bswap_constant_32', and to 0
if you don't. */
#undef HAVE_DECL___BSWAP_CONSTANT_32
/* Define to 1 if you have the declaration of `__bswap_constant_64', and to 0
if you don't. */
#undef HAVE_DECL___BSWAP_CONSTANT_64
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H

View File

@ -92,13 +92,13 @@
#define __cpu_to_le64(x) bswap_64(x)
/* For architectures that do not provide some/all of the constant versions. */
#ifndef __bswap_constant_16
#if defined HAVE_DECL___BSWAP_CONSTANT_16 && !HAVE_DECL___BSWAP_CONSTANT_16
#define __bswap_constant_16(x) bswap_16(x)
#endif
#ifndef __bswap_constant_32
#if defined HAVE_DECL___BSWAP_CONSTANT_32 && !HAVE_DECL___BSWAP_CONSTANT_32
#define __bswap_constant_32(x) bswap_32(x)
#endif
#ifndef __bswap_constant_64
#if defined HAVE_DECL___BSWAP_CONSTANT_64 && !HAVE_DECL___BSWAP_CONSTANT_64
#define __bswap_constant_64(x) bswap_64(x)
#endif