summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--hack/asm-generic/types.h9
-rw-r--r--lib/dedupe-range.c5
3 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 10ebe01..e6dffd6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
CFLAGS += -std=c11
CPPFLAGS += -I$(CURDIR)/lib
+CPPFLAGS += -I$(CURDIR)/hack
CFLAGS += -Wall -Werror -Wextra
CPPFLAGS += -O2 -D_FORTIFY_SOURCE=2
diff --git a/hack/asm-generic/types.h b/hack/asm-generic/types.h
new file mode 100644
index 0000000..ae07283
--- /dev/null
+++ b/hack/asm-generic/types.h
@@ -0,0 +1,9 @@
+/* Override Linux' (4.16.1) <asm-generic/types.h> to agree with GNU
+ * libc's (2.27) <bits/types.h> so that we can use Linux' __u64 and
+ * __s64 with libc's PRIu64 and PRUi64. */
+
+#if __WORDSIZE == 64
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
diff --git a/lib/dedupe-range.c b/lib/dedupe-range.c
index 016f691..cdb5044 100644
--- a/lib/dedupe-range.c
+++ b/lib/dedupe-range.c
@@ -61,10 +61,7 @@ void dedupe_range(struct range src, struct range *dsts) {
if (range->info[i].bytes_deduped != bytes_deduped) {
error(0, errno, "dedupe: %"PRIu64" != %"PRIu64": %s",
bytes_deduped,
- /* On platforms where both "long" and "long long"
- * are 64 bits, linux __u64 might disagree with
- * glibc uint64_t and thus PRIu64. */
- (uint64_t)range->info[i].bytes_deduped,
+ range->info[i].bytes_deduped,
dsts[files_deduped+i].filename);
erred = true;
}