libvbisam: Fix bugs around ecvt
`ecvt` was used undeclared in `libvbisam/isdecimal.c`. `__set_errno` was undefined.
This commit is contained in:
parent
55f72d2bde
commit
e87cd20082
@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="A replacement for IBM's C-ISAM"
|
||||
TERMUX_PKG_LICENSE="GPL-2.0, LGPL-2.1"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION=2.0
|
||||
TERMUX_PKG_REVISION=1
|
||||
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/vbisam/vbisam2/vbisam-${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=688b776e0030cce50fd7e44cbe40398ea93431f76510c7100433cc6313eabc4f
|
||||
|
||||
|
@ -30,6 +30,14 @@
|
||||
#define __FCVT_R fcvt
|
||||
#define __ECVT_R ecvt
|
||||
#define SNPRINTF snprintf
|
||||
#if __ANDROID_API__ >= 21
|
||||
static inline int
|
||||
__set_errno(int n)
|
||||
{
|
||||
errno = n;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SNPRINTF
|
||||
@ -40,6 +48,8 @@
|
||||
#define APPEND(a, b) APPEND2 (a, b)
|
||||
#define APPEND2(a, b) a##b
|
||||
|
||||
#pragma GCC visibility push(hidden)
|
||||
|
||||
int
|
||||
__FCVT_R (FLOAT_TYPE value, int ndigit, int *decpt, int *sign,
|
||||
char *buf, size_t len)
|
||||
@ -203,3 +213,5 @@ __ECVT_R (FLOAT_TYPE value, int ndigit, int *decpt, int *sign,
|
||||
*decpt += exponent;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma GCC visibility pop
|
||||
|
12
packages/libvbisam/libvbisam-isdecimal.c.patch
Normal file
12
packages/libvbisam/libvbisam-isdecimal.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- a/libvbisam/isdecimal.c
|
||||
+++ b/libvbisam/isdecimal.c
|
||||
@@ -134,6 +134,9 @@
|
||||
int decpt;
|
||||
int sign;
|
||||
|
||||
+#ifdef __ANDROID__
|
||||
+ char *ecvt(double, int, int *, int *);
|
||||
+#endif
|
||||
str = (unsigned char *)ecvt (dbl, ndigits, &decpt, &sign);
|
||||
|
||||
dp->dec_pos = sign ? 0 : 1;
|
Loading…
Reference in New Issue
Block a user