From 0dd38ddd7d03d1f69786b44b662049694fb3ad61 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Wed, 10 Mar 2004 10:22:03 +0000 Subject: [PATCH] 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) --- config.h.in | 12 ++++++++++++ include/ntfs/endians.h | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/config.h.in b/config.h.in index f9155955..b586808a 100644 --- a/config.h.in +++ b/config.h.in @@ -6,6 +6,18 @@ /* Define to 1 if you have the 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 header file. */ #undef HAVE_DLFCN_H diff --git a/include/ntfs/endians.h b/include/ntfs/endians.h index e43e7cc6..bb8cf543 100644 --- a/include/ntfs/endians.h +++ b/include/ntfs/endians.h @@ -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