summaryrefslogtreecommitdiffstats
path: root/package/joe/joe-0001-disable-bessel-functions-on-uclibc.patch
blob: 9f7b72c170e2e32eaf4f156eff2e0420f2b5ad66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[PATCH] uClibc can be (and by default is) configured without bessel functions

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 umath.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

Index: joe-3.7/umath.c
===================================================================
--- joe-3.7.orig/umath.c
+++ joe-3.7/umath.c
@@ -7,6 +7,12 @@
  */
 #include "types.h"
 
+/* uClibc can be configured without bessel functions */
+#include <features.h>
+#if defined (__UCLIBC__) && !defined(__DO_XSI_MATH__)
+#define NO_BESSEL
+#endif
+
 unsigned char *merr;
 
 int mode_hex;
@@ -396,10 +402,12 @@
 double m_fabs(double n) { return fabs(n); }
 double m_erf(double n) { return erf(n); }
 double m_erfc(double n) { return erfc(n); }
+#ifndef NO_BESSEL
 double m_j0(double n) { return j0(n); }
 double m_j1(double n) { return j1(n); }
 double m_y0(double n) { return y0(n); }
 double m_y1(double n) { return y1(n); }
+#endif
 
 double calc(BW *bw, unsigned char *s)
 {
@@ -434,10 +442,12 @@
 		v = get(USTR "abs"); v->func = m_fabs;
 		v = get(USTR "erf"); v->func = m_erf;
 		v = get(USTR "erfc"); v->func = m_erfc;
+#ifndef NO_BESSEL
 		v = get(USTR "j0"); v->func = m_j0;
 		v = get(USTR "j1"); v->func = m_j1;
 		v = get(USTR "y0"); v->func = m_y0;
 		v = get(USTR "y1"); v->func = m_y1;
+#endif
 	}
 
 	v = get(USTR "top");