#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <endian.h>
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+#endif
+#include <unistd.h>
#include <fcntl.h>
#include <time.h>
const unsigned char *tmp = addr;
return (tmp[nr >> 3] >> (nr & 7)) & 1;
#else
- return test_bit(nr, addr);
+ const unsigned long *tmp = addr;
+ return ((1UL << (nr & (BITS_PER_LONG - 1))) &
+ ((tmp)[nr / BITS_PER_LONG])) != 0;
#endif
}