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

strftime* api for *BSD #3483

Merged
merged 1 commit into from Dec 17, 2023
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
1 change: 1 addition & 0 deletions libc-test/semver/apple.txt
Expand Up @@ -2225,6 +2225,7 @@ statfs
strcasecmp
strcasestr
strftime
strftime_l
strncasecmp
strndup
strptime
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/dragonfly.txt
Expand Up @@ -1547,6 +1547,8 @@ stack_t
statfs
strcasecmp
strcasestr
strftime
strftime_l
strncasecmp
strndup
strsignal
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/freebsd.txt
Expand Up @@ -2204,6 +2204,8 @@ statfs
strcasecmp
strcasestr
strchrnul
strftime
strftime_l
strncasecmp
strndup
strsignal
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/netbsd.txt
Expand Up @@ -1551,6 +1551,8 @@ stack_t
strcasecmp
strcasestr
string_to_flags
strftime
strftime_l
strncasecmp
strndup
strpct
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/openbsd.txt
Expand Up @@ -1250,6 +1250,8 @@ stack_t
statfs
strcasecmp
strcasestr
strftime
strftime_l
strncasecmp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symbols are added twice in openbsd

strndup
strsignal
Expand Down
6 changes: 0 additions & 6 deletions src/unix/bsd/apple/mod.rs
Expand Up @@ -5604,12 +5604,6 @@ extern "C" {
pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
pub fn ctime(clock: *const time_t) -> *mut ::c_char;
pub fn getdate(datestr: *const ::c_char) -> *mut ::tm;
pub fn strftime(
buf: *mut ::c_char,
maxsize: ::size_t,
format: *const ::c_char,
timeptr: *const ::tm,
) -> ::size_t;
pub fn strptime(
buf: *const ::c_char,
format: *const ::c_char,
Expand Down
14 changes: 14 additions & 0 deletions src/unix/bsd/mod.rs
Expand Up @@ -899,6 +899,20 @@ extern "C" {
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;

pub fn strftime(
buf: *mut ::c_char,
maxsize: ::size_t,
format: *const ::c_char,
timeptr: *const ::tm,
) -> ::size_t;
pub fn strftime_l(
buf: *mut ::c_char,
maxsize: ::size_t,
format: *const ::c_char,
timeptr: *const ::tm,
locale: ::locale_t,
) -> ::size_t;
}

cfg_if! {
Expand Down