Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing string-to-number functions from ISO C #3036

Merged
merged 1 commit into from Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions libc-test/semver/android.txt
Expand Up @@ -2854,7 +2854,10 @@ arphdr
arpreq
arpreq_old
atexit
atof
atoi
atol
atoll
bind
blkcnt_t
blksize_t
Expand Down Expand Up @@ -3504,7 +3507,9 @@ strtod
strtof
strtok
strtol
strtoll
strtoul
strtoull
strxfrm
suseconds_t
swapoff
Expand Down
1 change: 0 additions & 1 deletion libc-test/semver/apple.txt
Expand Up @@ -1818,7 +1818,6 @@ arc4random
arc4random_buf
arc4random_uniform
arphdr
atof
attrgroup_t
attribute_set_t
attrlist
Expand Down
1 change: 0 additions & 1 deletion libc-test/semver/dragonfly.txt
Expand Up @@ -1221,7 +1221,6 @@ arc4random
arc4random_buf
arc4random_uniform
arphdr
atof
backtrace
backtrace_symbols
backtrace_symbols_fd
Expand Down
1 change: 0 additions & 1 deletion libc-test/semver/freebsd.txt
Expand Up @@ -1493,7 +1493,6 @@ arc4random
arc4random_buf
arc4random_uniform
arphdr
atof
au_asid_t
au_id_t
au_mask_t
Expand Down
5 changes: 5 additions & 0 deletions libc-test/semver/fuchsia.txt
Expand Up @@ -1168,6 +1168,9 @@ accept4
acct
aiocb
atof
atoi
atol
atoll
blkcnt64_t
brk
clearenv
Expand Down Expand Up @@ -1366,6 +1369,8 @@ stat64
statfs
statfs64
statvfs64
strtoll
strtoull
swapoff
swapon
sync
Expand Down
1 change: 0 additions & 1 deletion libc-test/semver/linux.txt
Expand Up @@ -2868,7 +2868,6 @@ arpd_request
arphdr
arpreq
arpreq_old
atof
blkcnt64_t
brk
bsearch
Expand Down
1 change: 0 additions & 1 deletion libc-test/semver/netbsd.txt
Expand Up @@ -1166,7 +1166,6 @@ arc4random
arc4random_buf
arc4random_uniform
arphdr
atof
bsearch
chflags
chroot
Expand Down
1 change: 0 additions & 1 deletion libc-test/semver/openbsd.txt
Expand Up @@ -977,7 +977,6 @@ arc4random
arc4random_buf
arc4random_uniform
arphdr
atof
backtrace
backtrace_symbols
backtrace_symbols_fd
Expand Down
5 changes: 5 additions & 0 deletions libc-test/semver/unix.txt
Expand Up @@ -451,7 +451,10 @@ access
addrinfo
alarm
atexit
atof
atoi
atol
atoll
bind
blkcnt_t
blksize_t
Expand Down Expand Up @@ -818,7 +821,9 @@ strtod
strtof
strtok
strtol
strtoll
strtoul
strtoull
strxfrm
suseconds_t
symlink
Expand Down
4 changes: 4 additions & 0 deletions libc-test/semver/windows.txt
Expand Up @@ -152,6 +152,8 @@ aligned_free
atexit
atof
atoi
atol
atoll
bind
c_char
c_double
Expand Down Expand Up @@ -307,7 +309,9 @@ strtod
strtof
strtok
strtol
strtoll
strtoul
strtoull
strxfrm
system
time
Expand Down
6 changes: 5 additions & 1 deletion src/fuchsia/mod.rs
Expand Up @@ -3402,11 +3402,16 @@ extern "C" {
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
Expand Down Expand Up @@ -3448,7 +3453,6 @@ extern "C" {
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;

pub fn abs(i: c_int) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn labs(i: c_long) -> c_long;
pub fn rand() -> c_int;
pub fn srand(seed: c_uint);
Expand Down
1 change: 0 additions & 1 deletion src/unix/bsd/mod.rs
Expand Up @@ -613,7 +613,6 @@ extern "C" {

pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
Expand Down
1 change: 0 additions & 1 deletion src/unix/haiku/mod.rs
Expand Up @@ -1592,7 +1592,6 @@ extern "C" {
pub fn _errnop() -> *mut ::c_int;

pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
Expand Down
1 change: 0 additions & 1 deletion src/unix/hermit/mod.rs
Expand Up @@ -966,7 +966,6 @@ extern "C" {
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;

pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
Expand Down
1 change: 0 additions & 1 deletion src/unix/linux_like/emscripten/mod.rs
Expand Up @@ -1763,7 +1763,6 @@ extern "C" {
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;

pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
Expand Down
1 change: 0 additions & 1 deletion src/unix/linux_like/linux/mod.rs
Expand Up @@ -3804,7 +3804,6 @@ extern "C" {
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;

pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
Expand Down
5 changes: 5 additions & 0 deletions src/unix/mod.rs
Expand Up @@ -492,15 +492,20 @@ extern "C" {
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn clearerr(stream: *mut FILE);
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "strtod$UNIX2003"
)]
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
Expand Down
1 change: 0 additions & 1 deletion src/unix/newlib/mod.rs
Expand Up @@ -621,7 +621,6 @@ extern "C" {
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;

pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
Expand Down
1 change: 0 additions & 1 deletion src/unix/solarish/mod.rs
Expand Up @@ -2710,7 +2710,6 @@ extern "C" {

pub fn abs(i: ::c_int) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
Expand Down
5 changes: 5 additions & 0 deletions src/vxworks/mod.rs
Expand Up @@ -1119,11 +1119,16 @@ extern "C" {
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
Expand Down
6 changes: 5 additions & 1 deletion src/wasi.rs
Expand Up @@ -540,12 +540,16 @@ extern "C" {
pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;

pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
Expand Down
6 changes: 5 additions & 1 deletion src/windows/mod.rs
Expand Up @@ -329,11 +329,16 @@ extern "C" {
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
Expand Down Expand Up @@ -374,7 +379,6 @@ extern "C" {
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;

pub fn abs(i: c_int) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn labs(i: c_long) -> c_long;
pub fn rand() -> c_int;
pub fn srand(seed: c_uint);
Expand Down