ports/sysutils/dd_rescue/files/patch-ffs.h
MANTANI Nobutaka 32c8a26e27 - Update to 1.99.8.
- Regenerate patches with make makepatch.
2018-07-15 16:45:41 +00:00

50 lines
1 KiB
C

--- ffs.h.orig 2015-08-27 15:45:57 UTC
+++ ffs.h
@@ -27,7 +27,15 @@
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
+#include <stdint.h>
+#ifndef __WORDSIZE
+#if defined(UINTPTR_MAX) && defined(UINT64_MAX) && (UINTPTR_MAX == UINT64_MAX)
+#define __WORDSIZE 64
+#else
+#define __WORDSIZE 32
+#endif
+#endif
#ifdef HAVE_FFS
# define myffs(x) ffs(x)
@@ -54,12 +62,9 @@
# define myffsl(x) myffsl_c(x)
#endif
-#ifndef __BYTE_ORDER
+#ifndef BYTE_ORDER
# error Need to define __BYTE_ORDER
#endif
-#ifndef __WORDSIZE
-# error Need to define __WORDSIZE
-#endif
//#ifndef HAVE_FFS
#ifdef NEED_FFSL_C
@@ -93,7 +98,7 @@ static int myffsl_c(unsigned long val)
}
#endif
-#if __BYTE_ORDER == __BIG_ENDIAN || defined(TEST)
+#if BYTE_ORDER == BIG_ENDIAN || defined(TEST)
/** Find last (highest) bit set in word val, returns a val b/w __WORDSIZE and 1, 0 if no bit is set */
static int myflsl(unsigned long val)
{
@@ -132,6 +137,8 @@ static int myflsl(unsigned long val)
return res;
#endif
}
+#else
+# define myflsl(x) flsl(x)
#endif
void probe_sse42();