[Zsync-users] off_t print macro not working on ARM [patch]
Status: Beta
Brought to you by:
cph
From: René F. <re...@fi...> - 2014-05-20 12:51:02
|
Hi, I've successfully compiled zsync for ARMv7, but downloading didn't work. After some debugging, I found that the "Range: bytes=" header contains garbage data. This is because sizeof(off_t) == 8 and SIZEOF_OFF_T == 4 (defined by configure). This confuses format_string.h to incorrectly define the 32-bit version of the OFF_T_PF macro. The following patch fixes should fix it (tested on ARMv7 and x86-64). Kind regards, Rene >From b096a8b77e627e2f56847a7bd573c0b901a0e95e Mon Sep 17 00:00:00 2001 From: rene <re...@fi...> Date: Tue, 20 May 2014 14:32:09 +0200 Subject: [PATCH] Fix off_t print macro on some platforms (notably ARMv7) when defines SIZEOF_OFF_T and __USE_FILE_OFFSET64 are conflicting. --- c/format_string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/format_string.h b/c/format_string.h index 7b21773..4c327e6 100644 --- a/c/format_string.h +++ b/c/format_string.h @@ -21,7 +21,7 @@ # define SIZE_T_PF "%u" #endif -#if SIZEOF_OFF_T == 8 +#if SIZEOF_OFF_T == 8 || defined __USE_FILE_OFFSET64 # ifdef PRIu64 # define OFF_T_PF "%" PRIu64 # else -- 1.9.1 |