tdf#48459 sw inline heading: don't apply inside frames or over 120 chars
[LibreOffice.git] / external / dtoa / include_header.patch
blob7cf0a8a2147102fd5d78fe9ba6a10f6149fca14e
1 --- /dev/null
2 +++ dtoa/include/dtoa.h
3 @@ -0,0 +1,1 @@
4 +extern "C" double strtod_nolocale(const char *s00, char **se);
5 --- dtoa/src/dtoa.c.orig
6 +++ dtoa/src/dtoa.c
7 @@ -268,7 +268,7 @@ #ifndef PRIVATE_MEM
8 #define PRIVATE_MEM 2304
9 #endif
10 #define PRIVATE_mem ((PRIVATE_MEM+sizeof(double)-1)/sizeof(double))
11 -static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
12 +static thread_local double private_mem[PRIVATE_mem], *pmem_next = private_mem;
13 #endif
15 #undef IEEE_Arith
16 @@ -1502,9 +1502,7 @@ static unsigned int maxthreads = 0;
17 #define Kmax 7
19 #ifdef __cplusplus
20 -extern "C" double strtod(const char *s00, char **se);
21 -extern "C" char *dtoa(double d, int mode, int ndigits,
22 - int *decpt, int *sign, char **rve);
23 +extern "C" double strtod_nolocale(const char *s00, char **se);
24 #endif
26 struct
27 @@ -1521,7 +1519,7 @@ ThInfo {
28 Bigint *P5s;
29 } ThInfo;
31 - static ThInfo TI0;
32 + static thread_local ThInfo TI0;
34 #ifdef MULTIPLE_THREADS
35 static ThInfo *TI1;
36 @@ -1529,7 +1527,7 @@ #ifdef MULTIPLE_THREADS
37 static ThInfo *TI1;
38 static int TI0_used;
40 - void
41 + static void
42 set_max_dtoa_threads(unsigned int n)
44 size_t L;
45 @@ -2717,7 +2715,7 @@ enum { /* rounding values: same as FLT_ROUNDS */
46 Round_down = 3
49 - void
50 + static void
51 gethex( const char **sp, U *rvp, int rounding, int sign MTd)
53 Bigint *b;
54 @@ -3429,7 +3427,7 @@ retlow1:
55 #endif /* NO_STRTOD_BIGCOMP */
57 double
58 -strtod(const char *s00, char **se)
59 +strtod_nolocale(const char *s00, char **se)
61 int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, e, e1;
62 int esign, i, j, k, nd, nd0, nf, nz, nz0, nz1, sign;
63 @@ -4851,7 +4849,7 @@ strtod_nolocale(const char *s00, char **se)
66 #ifndef MULTIPLE_THREADS
67 - static char *dtoa_result;
68 + static thread_local char *dtoa_result;
69 #endif
71 static char *
72 @@ -4902,7 +4900,7 @@ nrv_alloc(const char *s, char *s0, size_t s0len, char **rve, int n MTd)
73 * when MULTIPLE_THREADS is not defined.
76 - void
77 + static void
78 freedtoa(char *s)
80 #ifdef MULTIPLE_THREADS
81 @@ -4951,7 +4949,7 @@ freedtoa(char *s)
82 * calculation.
85 - char *
86 + static char *
87 dtoa_r(double dd, int mode, int ndigits, int *decpt, int *sign, char **rve, char *buf, size_t blen)
89 /* Arguments ndigits, decpt, sign are similar to those
90 @@ -6184,8 +6182,8 @@ dtoa_r(double dd, int mode, int ndigits, int *decpt, int *sign, char **rve, char
91 return buf;
94 - char *
95 -dtoa(double dd, int mode, int ndigits, int *decpt, int *sign, char **rve)
96 + static char *
97 +dtoa_nolocale(double dd, int mode, int ndigits, int *decpt, int *sign, char **rve)
99 /* Sufficient space is allocated to the return value
100 to hold the suppressed trailing zeros.