]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
modula2: Export all string to integral and fp number conversion functions
authorGaius Mulley <gaiusmod2@gmail.com>
Sat, 24 Aug 2024 21:43:55 +0000 (22:43 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Sat, 24 Aug 2024 21:43:55 +0000 (22:43 +0100)
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.gottwalt@posteo.net>
gcc/m2/gm2-libs/libc.def

index a314b59e43f15572f651855530cbc71e8a6402b3..e278617c2d86b0a716dacab8c35bced8744fc983 100644 (file)
@@ -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)
 *)