summaryrefslogtreecommitdiff
path: root/lib/ext2fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-09-28 20:27:03 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-09-28 20:27:03 -0400
commita378bd5a5a80656ad1782ee80fa301a5ecb10ecb (patch)
treea1360fb08180f9bfed29a3fcc71aca7362f0a95a /lib/ext2fs
parent38a420bfce58a4f32685e41104cd1dc4fd7d5013 (diff)
downloade2fsprogs-a378bd5a5a80656ad1782ee80fa301a5ecb10ecb.tar.gz
libext2fs: use ext2fs byte swap functions for portability
The functions htole32(), le32toh(), be32toh(), htobe32() aren't defined in all environments. Use the ext2fs byte swap functions for portability. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs')
-rw-r--r--lib/ext2fs/crc32c_defs.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/ext2fs/crc32c_defs.h b/lib/ext2fs/crc32c_defs.h
index 17529706..ced4f67a 100644
--- a/lib/ext2fs/crc32c_defs.h
+++ b/lib/ext2fs/crc32c_defs.h
@@ -42,18 +42,19 @@
(((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) (htole32((x)))
-#define __le32_to_cpu(x) (le32toh((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) (be32toh((x)))
-#define __cpu_to_be32(x) (htobe32((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