From 4e33c3992e219099bada6a098e73f269f445bb57 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sun, 30 May 2010 11:40:19 +0300 Subject: Use 0/1 instead of defined/undefined for XZ_INTERNAL_CRC32. Code that used #define XZ_INTERNAL_CRC32 will now need to use: #define XZ_INTERNAL_CRC32 1 This is to make it a little bit easier to use external CRC32 implementation outside the Linux kernel by using #define XZ_INTERNAL_CRC32 0 and then providing xz_crc32() e.g. via xz_config.h. --- linux/include/linux/xz.h | 10 +++++++++- linux/lib/decompress_unxz.c | 2 +- linux/lib/xz/xz_stream.h | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/linux/include/linux/xz.h b/linux/include/linux/xz.h index 9d92499..824c0a7 100644 --- a/linux/include/linux/xz.h +++ b/linux/include/linux/xz.h @@ -186,7 +186,15 @@ XZ_EXTERN void XZ_FUNC xz_dec_end(struct xz_dec *s); * CRC32 module is used instead, and users of this module don't need to * care about the functions below. */ -#if !defined(__KERNEL__) || defined(XZ_INTERNAL_CRC32) +#ifndef XZ_INTERNAL_CRC32 +# ifdef __KERNEL__ +# define XZ_INTERNAL_CRC32 0 +# else +# define XZ_INTERNAL_CRC32 1 +# endif +#endif + +#if XZ_INTERNAL_CRC32 /* * This must be called before any other xz_* function to initialize * the CRC32 lookup table. diff --git a/linux/lib/decompress_unxz.c b/linux/lib/decompress_unxz.c index 4e9c860..880f301 100644 --- a/linux/lib/decompress_unxz.c +++ b/linux/lib/decompress_unxz.c @@ -128,7 +128,7 @@ * Use the internal CRC32 code instead of kernel's CRC32 module, which * is not available in early phase of booting. */ -#define XZ_INTERNAL_CRC32 +#define XZ_INTERNAL_CRC32 1 /* * Ignore the configuration specified in the kernel config for the xz_dec diff --git a/linux/lib/xz/xz_stream.h b/linux/lib/xz/xz_stream.h index bb70b09..5b9318b 100644 --- a/linux/lib/xz/xz_stream.h +++ b/linux/lib/xz/xz_stream.h @@ -10,7 +10,7 @@ #ifndef XZ_STREAM_H #define XZ_STREAM_H -#if defined(__KERNEL__) && !defined(XZ_INTERNAL_CRC32) +#if defined(__KERNEL__) && !XZ_INTERNAL_CRC32 # include # undef crc32 # define xz_crc32(buf, size, crc) \ -- cgit v1.2.3