void-packages/srcpkgs/calc/patches/endian-32.patch

38 lines
1.6 KiB
Diff

Description: Restore filepos2z() implementation from apcalc 2.12.1.5
Fixes a FTBFS bug on big endian machines.
This is probably not the right solution, but at least it works.
.
Update 2019-01-14: Still required with calc 2.12.7.2 on mips, otherwise, we
get this (on minkus.debian.org, sid chroot):
.
gcc -DCALC_SRC -DCUSTOM -Wall -g -O2 -fdebug-prefix-map=/home/mbuck/apcalc-2.12.7.2=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -g3 -Wno-error=long-long -Wno-long-long -c file.c
In file included from qmath.h:32,
from cmath.h:32,
from value.h:33,
from calc.h:33,
from file.c:39:
file.c: In function 'filepos2z':
zmath.h:85:46: error: incompatible types when assigning to type 'HALF' {aka 'long unsigned int'} from type 'FILEPOS' {aka 'struct _G_fpos_t'}
#define SWAP_HALF_IN_B32(dest, src) (*(dest) = *(src))
^
fposval.h:15:42: note: in expansion of macro 'SWAP_HALF_IN_B32'
#define SWAP_HALF_IN_FILEPOS(dest, src) SWAP_HALF_IN_B32(dest, src)
^~~~~~~~~~~~~~~~
file.c:1370:2: note: in expansion of macro 'SWAP_HALF_IN_FILEPOS'
SWAP_HALF_IN_FILEPOS(ret.v, &pos);
^~~~~~~~~~~~~~~~~~~~
Bug-Debian: http://bugs.debian.org/414893
Forwarded: yes
Author: Martin Buck <mbuck@debian.org>
---
--- file.c
+++ file.c
@@ -1367,7 +1367,7 @@
ret.len = FILEPOS_BITS/BASEB;
ret.v = alloc(ret.len);
zclearval(ret);
- SWAP_HALF_IN_FILEPOS(ret.v, &pos);
+ SWAP_HALF_IN_FILEPOS(ret.v, (HALF *)&pos);
ret.sign = 0;
ztrim(&ret);