Whamcloud - gitweb
Fix gcc and clang warnings
[tools/e2fsprogs.git] / lib / ext2fs / jfs_compat.h
index d92f931..f1a3f96 100644 (file)
@@ -7,7 +7,11 @@
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_WINSOCK_H
+#include <winsock.h>
+#else
 #include <arpa/inet.h>
+#endif
 
 #define printk printf
 #define KERN_ERR ""
@@ -23,6 +27,7 @@
 
 typedef unsigned int tid_t;
 typedef struct journal_s journal_t;
+typedef struct kdev_s *kdev_t;
 
 struct buffer_head;
 struct inode;
@@ -36,8 +41,9 @@ typedef __u64 u64;
 #define put_bh(x)      brelse(x)
 #define be64_to_cpu(x) ext2fs_be64_to_cpu(x)
 
-static inline __u32 jbd2_chksum(journal_t *j, __u32 crc, const void *address,
-                       unsigned int length)
+static inline __u32 jbd2_chksum(journal_t *j EXT2FS_ATTR((unused)),
+                               __u32 crc, const void *address,
+                               unsigned int length)
 {
        return ext2fs_crc32c_le(crc, address, length);
 }
@@ -81,14 +87,6 @@ struct journal_s
        __u32                   j_csum_seed;
 };
 
-#define J_ASSERT(assert)                                               \
-       do { if (!(assert)) {                                           \
-               printf ("Assertion failure in %s() at %s line %d: "     \
-                       "\"%s\"\n",                                     \
-                       __FUNCTION__, __FILE__, __LINE__, # assert);    \
-               fatal_error(e2fsck_global_ctx, 0);                      \
-       } } while (0)
-
 #define is_journal_abort(x) 0
 
 #define BUFFER_TRACE(bh, info) do {} while (0)