Skip to content

Commit 21d90af

Browse files
committed
Auto merge of #3152 - shua:mactime, r=JohnTitor
mac time.h functions I used these in https://github.com/shua/graf because I'm used to them, and don't really want to pull in time or chrono just for some stuff already present in libc.h . Compilation worked fine on my linux target, but failed on mac osx because these weren't defined in rust-lang/libc (but these are all present in 13.1 SDK).
2 parents a7c13b9 + 78244fe commit 21d90af

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

libc-test/semver/apple.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,8 @@ arc4random
18191819
arc4random_buf
18201820
arc4random_uniform
18211821
arphdr
1822+
asctime
1823+
asctime_r
18221824
attrgroup_t
18231825
attribute_set_t
18241826
attrlist
@@ -1845,6 +1847,8 @@ copyfile
18451847
copyfile_flags_t
18461848
cpu_subtype_t
18471849
cpu_type_t
1850+
ctime
1851+
ctime_r
18481852
ctl_info
18491853
difftime
18501854
dirfd
@@ -1880,6 +1884,7 @@ futimes
18801884
getattrlist
18811885
getattrlistat
18821886
getattrlistbulk
1887+
getdate
18831888
getdomainname
18841889
getdtablesize
18851890
getfsstat
@@ -2181,8 +2186,10 @@ stack_t
21812186
statfs
21822187
strcasecmp
21832188
strcasestr
2189+
strftime
21842190
strncasecmp
21852191
strndup
2192+
strptime
21862193
strsignal
21872194
strtonum
21882195
sync

src/unix/bsd/apple/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5121,6 +5121,23 @@ extern "C" {
51215121
pub fn endutxent();
51225122
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
51235123

5124+
pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
5125+
pub fn ctime(clock: *const time_t) -> *mut ::c_char;
5126+
pub fn getdate(datestr: *const ::c_char) -> *mut ::tm;
5127+
pub fn strftime(
5128+
buf: *mut ::c_char,
5129+
maxsize: ::size_t,
5130+
format: *const ::c_char,
5131+
timeptr: *const ::tm,
5132+
) -> ::size_t;
5133+
pub fn strptime(
5134+
buf: *const ::c_char,
5135+
format: *const ::c_char,
5136+
timeptr: *mut ::tm,
5137+
) -> *mut ::c_char;
5138+
pub fn asctime_r(tm: *const ::tm, result: *mut ::c_char) -> *mut ::c_char;
5139+
pub fn ctime_r(clock: *const time_t, result: *mut ::c_char) -> *mut ::c_char;
5140+
51245141
pub fn getnameinfo(
51255142
sa: *const ::sockaddr,
51265143
salen: ::socklen_t,

0 commit comments

Comments
 (0)