diff mbox series

gm2: export all libc number conversion functions

Message ID ZsTf4DA1mTN6UcUC@monster.localdomain
State New
Headers show
Series gm2: export all libc number conversion functions | expand

Commit Message

Wilken Gottwalt Aug. 20, 2024, 6:26 p.m. UTC
Export all string to integral and floating point number conversion functions
(atof, atoi, atol, atoll, strtod, strtof, strtold, strtol, strtoll, strtoul,
strtoull).

gcc/gm2:
	* gm2-libs/libc.def: Export all string to number conversion functions.

Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>
---
 gcc/m2/gm2-libs/libc.def | 84 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

Comments

Gaius Mulley Aug. 23, 2024, 9:12 p.m. UTC | #1
Wilken Gottwalt <wilken.gottwalt@posteo.net> writes:

> Export all string to integral and floating point number conversion functions
> (atof, atoi, atol, atoll, strtod, strtof, strtold, strtol, strtoll, strtoul,
> strtoull).
>
> gcc/gm2:
> 	* gm2-libs/libc.def: Export all string to number conversion functions.
>
> Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>

Hi Wilken,

many thanks for the patch (I'll apply it) - yes lgtm,

regards,
Gaius
diff mbox series

Patch

diff --git a/gcc/m2/gm2-libs/libc.def b/gcc/m2/gm2-libs/libc.def
index a314b59e43f..e278617c2d8 100644
--- a/gcc/m2/gm2-libs/libc.def
+++ b/gcc/m2/gm2-libs/libc.def
@@ -29,6 +29,8 @@  DEFINITION MODULE FOR "C" libc ;
 FROM SYSTEM IMPORT ADDRESS, CSIZE_T, CSSIZE_T ;
 
 EXPORT UNQUALIFIED time_t, timeb, tm, ptrToTM,
+                   atof, atoi, atol, atoll,
+                   strtod, strtof, strtold, strtol, strtoll, strtoul, strtoull,
                    write, read,
                    system, abort,
                    malloc, free,
@@ -75,6 +77,88 @@  TYPE
    exitP = PROCEDURE () : INTEGER ;
 
 
+(*
+     double atof(const char *nptr)
+*)
+
+PROCEDURE atof (nptr: ADDRESS) : REAL ;
+
+
+(*
+     int atoi(const char *nptr)
+*)
+
+PROCEDURE atoi (nptr: ADDRESS) : INTEGER ;
+
+
+(*
+     long atol(const char *nptr);
+*)
+
+PROCEDURE atol (nptr: ADDRESS) : CSSIZE_T ;
+
+
+(*
+     long long atoll(const char *nptr);
+*)
+
+PROCEDURE atoll (nptr: ADDRESS) : LONGINT ;
+
+
+(*
+     double strtod(const char *restrict nptr, char **_Nullable restrict endptr)
+*)
+
+PROCEDURE strtod (nptr, endptr: ADDRESS) : REAL ;
+
+
+(*
+     float strtof(const char *restrict nptr, char **_Nullable restrict endptr)
+*)
+
+PROCEDURE strtof (nptr, endptr: ADDRESS) : SHORTREAL ;
+
+
+(*
+     long double strtold(const char *restrict nptr,
+                         char **_Nullable restrict endptr)
+*)
+
+PROCEDURE strtold (nptr, endptr: ADDRESS) : LONGREAL ;
+
+
+(*
+     long strtol(const char *restrict nptr, char **_Nullable restrict endptr,
+                 int base)
+*)
+
+PROCEDURE strtol (nptr, endptr: ADDRESS; base: INTEGER) : CSSIZE_T ;
+
+
+(*
+     long long strtoll(const char *restrict nptr,
+                       char **_Nullable restrict endptr, int base)
+*)
+
+PROCEDURE strtoll (nptr, endptr: ADDRESS; base: INTEGER) : LONGINT ;
+
+
+(*
+     unsigned long strtoul(const char *restrict nptr,
+                           char **_Nullable restrict endptr, int base)
+*)
+
+PROCEDURE strtoul (nptr, endptr: ADDRESS; base: INTEGER) : CSIZE_T ;
+
+
+(*
+     unsigned long long strtoull(const char *restrict nptr,
+                                 char **_Nullable restrict endptr, int base)
+*)
+
+PROCEDURE strtoull (nptr, endptr: ADDRESS; base: INTEGER) : LONGCARD ;
+
+
 (*
      ssize_t write (int d, void *buf, size_t nbytes)
 *)