summaryrefslogtreecommitdiff
path: root/lib/ext2fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-10-03 22:49:45 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-10-03 22:49:45 -0400
commit8232f2ddaece256afd323eb5a289a5ec1b7fbd1a (patch)
tree03bddc7250d2a0aae731b7cde50f9007310fe30b /lib/ext2fs
parent200569608fc6e33f6546c17999f14fb5dbb0b9b5 (diff)
downloade2fsprogs-8232f2ddaece256afd323eb5a289a5ec1b7fbd1a.tar.gz
libext2fs: move #include "ext2fs.h" from crc32c_defs.h to crc32c.c
The byte swap functions which are defined in ext2fs.h are only needed by crc32.c, and not by gen_crc32ctable.c. The gen_crc32ctable program needs to be compiled on the host OS, where ext2fs.h may not be present. So move the use of the header function to crc32c.c, to avoid compilation problems. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs')
-rw-r--r--lib/ext2fs/crc32c.c17
-rw-r--r--lib/ext2fs/crc32c_defs.h17
2 files changed, 17 insertions, 17 deletions
diff --git a/lib/ext2fs/crc32c.c b/lib/ext2fs/crc32c.c
index 65bca5c3..6be43369 100644
--- a/lib/ext2fs/crc32c.c
+++ b/lib/ext2fs/crc32c.c
@@ -40,6 +40,23 @@
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
#include "crc32c_defs.h"
+#include "ext2fs.h"
+#ifdef WORDS_BIGENDIAN
+#define __constant_cpu_to_le32(x) ___constant_swab32((x))
+#define __constant_cpu_to_be32(x) (x)
+#define __be32_to_cpu(x) (x)
+#define __cpu_to_be32(x) (x)
+#define __cpu_to_le32(x) (ext2fs_cpu_to_le32((x)))
+#define __le32_to_cpu(x) (ext2fs_le32_to_cpu((x)))
+#else
+#define __constant_cpu_to_le32(x) (x)
+#define __constant_cpu_to_be32(x) ___constant_swab32((x))
+#define __be32_to_cpu(x) (ext2fs_be32_to_cpu((x)))
+#define __cpu_to_be32(x) (ext2fs_cpu_to_be32((x)))
+#define __cpu_to_le32(x) (x)
+#define __le32_to_cpu(x) (x)
+#endif
+
#if CRC_LE_BITS > 8
# define tole(x) (__force uint32_t) __constant_cpu_to_le32(x)
#else
diff --git a/lib/ext2fs/crc32c_defs.h b/lib/ext2fs/crc32c_defs.h
index ced4f67a..023f2c01 100644
--- a/lib/ext2fs/crc32c_defs.h
+++ b/lib/ext2fs/crc32c_defs.h
@@ -42,23 +42,6 @@
(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
-#include "ext2fs.h"
-#ifdef WORDS_BIGENDIAN
-#define __constant_cpu_to_le32(x) ___constant_swab32((x))
-#define __constant_cpu_to_be32(x) (x)
-#define __be32_to_cpu(x) (x)
-#define __cpu_to_be32(x) (x)
-#define __cpu_to_le32(x) (ext2fs_cpu_to_le32((x)))
-#define __le32_to_cpu(x) (ext2fs_le32_to_cpu((x)))
-#else
-#define __constant_cpu_to_le32(x) (x)
-#define __constant_cpu_to_be32(x) ___constant_swab32((x))
-#define __be32_to_cpu(x) (ext2fs_be32_to_cpu((x)))
-#define __cpu_to_be32(x) (ext2fs_cpu_to_be32((x)))
-#define __cpu_to_le32(x) (x)
-#define __le32_to_cpu(x) (x)
-#endif
-
#if (__GNUC__ >= 3)
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)