$NetBSD: patch-ag,v 1.1.1.1 2007/10/20 15:32:11 noud4 Exp $

--- include/mtd/jffs2-user.h	2006-10-07 17:33:37.000000000 +0200
+++ include/mtd/jffs2-user.h.new	2007-08-28 18:46:13.000000000 +0200
@@ -9,8 +9,13 @@
 
 /* This file is blessed for inclusion by userspace */
 #include <linux/jffs2.h>
+#if __NetBSD__
+#include <sys/endian.h>
+#include <machine/bswap.h>
+#else
 #include <endian.h>
 #include <byteswap.h>
+#endif
 
 #undef cpu_to_je16
 #undef cpu_to_je32
@@ -26,8 +26,8 @@
 
 extern int target_endian;
 
-#define t16(x) ({ uint16_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
-#define t32(x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
+#define t16(x) ({ uint16_t __b = (x); (target_endian==_BYTE_ORDER)?__b:bswap16(__b); })
+#define t32(x) ({ uint32_t __b = (x); (target_endian==_BYTE_ORDER)?__b:bswap32(__b); })
 
 #define cpu_to_je16(x) ((jint16_t){t16(x)})
 #define cpu_to_je32(x) ((jint32_t){t32(x)})
