-
Notifications
You must be signed in to change notification settings - Fork 0
/
float-strto.c.m4
47 lines (40 loc) · 1.56 KB
/
float-strto.c.m4
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
/*
Copyright © 2023 Barry Schwartz
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License, as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License
along with this program. If not, see
<https://www.gnu.org/licenses/>.
*/
include(`common-macros.m4')m4_include(`ats2-xprelude-macros.m4')
/*------------------------------------------------------------------*/
#include <xprelude/CATS/float.cats>
/*------------------------------------------------------------------*/
m4_foreachq(`FLT1',`conventional_floattypes',`
FLOAT_SUPPORT_CHECK(FLT1)
#if HAVE_`'m4_toupper(strto`'floatt2sfxld(FLT1))
atsvoid_t0ype
my_extern_prefix`'FLT1`'_strto_replace (REF(FLT1) zp, REF(size) jp,
atstype_string s, uintb2c(size) i)
{
floatt2c(FLT1) *z = (void *) zp;
uintb2c(size) *j = (void *) jp;
char *startptr = (char *) (void *) s + i;
char *endptr;
*z = strto`'floatt2sfxld(`FLT1') (startptr, &endptr);
*j = i + (uintb2c(size)) (endptr - startptr);
}
#endif
END_FLOAT_SUPPORT_CHECK(FLT1)
')dnl
/*------------------------------------------------------------------*/
dnl
dnl local variables:
dnl mode: C
dnl end: