aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-05-30 11:40:19 +0300
committerLasse Collin <lasse.collin@tukaani.org>2010-05-30 11:40:19 +0300
commit4e33c3992e219099bada6a098e73f269f445bb57 (patch)
tree4585647ff7ef2acc40aadedad91b68fb2b71e76a
parent7dabf0ef8731bb9cb001f37a7bfb9146bf2a362c (diff)
downloadxz-embedded-4e33c3992e219099bada6a098e73f269f445bb57.tar.gz
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.
-rw-r--r--linux/include/linux/xz.h10
-rw-r--r--linux/lib/decompress_unxz.c2
-rw-r--r--linux/lib/xz/xz_stream.h2
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 <linux/crc32.h>
# undef crc32
# define xz_crc32(buf, size, crc) \