https://gcc.gnu.org/g:ecc999b0224db06c1a7d8a4128bfa2ed162e2a61

commit r15-3156-gecc999b0224db06c1a7d8a4128bfa2ed162e2a61
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Sat Aug 24 22:43:55 2024 +0100

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

Diff:
---
 gcc/m2/gm2-libs/libc.def | 84 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/gcc/m2/gm2-libs/libc.def b/gcc/m2/gm2-libs/libc.def
index a314b59e43f1..e278617c2d86 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)
 *)

Reply via email to