Skip to content

Commit

Permalink
Auto merge of #3483 - devnexen:strftime_bsd, r=JohnTitor
Browse files Browse the repository at this point in the history
strftime* api for *BSD

close #3459
  • Loading branch information
bors committed Dec 17, 2023
2 parents ccdae50 + aff5e66 commit 07e3912
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
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
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

0 comments on commit 07e3912

Please sign in to comment.