From 77c794f202648f7f64f10ec912aa1dca2c453ddc Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Wed, 10 Mar 2004 15:17:51 +0000 Subject: [PATCH] Try the SuSE patch. (Logical change 1.315) --- include/ntfs/endians.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/include/ntfs/endians.h b/include/ntfs/endians.h index bb8cf543..7b2a05b6 100644 --- a/include/ntfs/endians.h +++ b/include/ntfs/endians.h @@ -92,14 +92,26 @@ #define __cpu_to_le64(x) bswap_64(x) /* For architectures that do not provide some/all of the constant versions. */ -#if defined HAVE_DECL___BSWAP_CONSTANT_16 && !HAVE_DECL___BSWAP_CONSTANT_16 -#define __bswap_constant_16(x) bswap_16(x) +#ifndef __bswap_constant_16 +#define __bswap_constant_16(x) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) #endif -#if defined HAVE_DECL___BSWAP_CONSTANT_32 && !HAVE_DECL___BSWAP_CONSTANT_32 -#define __bswap_constant_32(x) bswap_32(x) +#ifndef __bswap_constant_32 +#define __bswap_constant_32(x) \ + ((((x) & 0xff000000) >> 24) | \ + (((x) & 0x00ff0000) >> 8) | \ + (((x) & 0x0000ff00) << 8) | \ + (((x) & 0x000000ff) << 24)) #endif -#if defined HAVE_DECL___BSWAP_CONSTANT_64 && !HAVE_DECL___BSWAP_CONSTANT_64 -#define __bswap_constant_64(x) bswap_64(x) +#ifndef __bswap_constant_64 +#define __bswap_constant_64(x) \ + ((((x) & 0xff00000000000000ull) >> 56) | \ + (((x) & 0x00ff000000000000ull) >> 40) | \ + (((x) & 0x0000ff0000000000ull) >> 24) | \ + (((x) & 0x000000ff00000000ull) >> 8) | \ + (((x) & 0x00000000ff000000ull) << 8) | \ + (((x) & 0x0000000000ff0000ull) << 24) | \ + (((x) & 0x000000000000ff00ull) << 40) | \ + (((x) & 0x00000000000000ffull) << 56)) #endif #define __constant_le16_to_cpu(x) __bswap_constant_16(x)