Skip to content

Commit 5b877e7

Browse files
arihant2mathtgross35
authored andcommitted
add more windows time.h functions
(cherry picked from commit 35a32a7) (backport <rust-lang#4427>)
1 parent 3336d6b commit 5b877e7

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

libc-test/semver/windows.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,15 @@ c_void
174174
calloc
175175
chdir
176176
chmod
177+
clock
177178
clock_t
178179
close
179180
commit
180181
connect
181182
creat
183+
ctime
182184
dev_t
185+
difftime
183186
dup
184187
dup2
185188
errno_t
@@ -214,7 +217,11 @@ fsetpos
214217
fstat
215218
ftell
216219
fwrite
220+
get_daylight
221+
get_dstbias
217222
get_osfhandle
223+
get_timezone
224+
get_tzname
218225
getchar
219226
getcwd
220227
getenv
@@ -326,6 +333,7 @@ tm
326333
tmpfile
327334
tolower
328335
toupper
336+
tzset
329337
uint16_t
330338
uint32_t
331339
uint64_t

src/windows/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,25 @@ extern "C" {
382382
pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t;
383383
pub fn raise(signum: c_int) -> c_int;
384384

385+
pub fn clock() -> clock_t;
386+
pub fn ctime(sourceTime: *const time_t) -> *mut c_char;
387+
pub fn difftime(timeEnd: time_t, timeStart: time_t) -> c_double;
385388
#[link_name = "_gmtime64_s"]
386389
pub fn gmtime_s(destTime: *mut tm, srcTime: *const time_t) -> c_int;
390+
#[link_name = "_get_daylight"]
391+
pub fn get_daylight(hours: *mut c_int) -> errno_t;
392+
#[link_name = "_get_dstbias"]
393+
pub fn get_dstbias(seconds: *mut c_long) -> errno_t;
394+
#[link_name = "_get_timezone"]
395+
pub fn get_timezone(seconds: *mut c_long) -> errno_t;
396+
#[link_name = "_get_tzname"]
397+
pub fn get_tzname(p_return_value: *mut size_t, time_zone_name: *mut c_char, size_in_bytes: size_t, index: c_int) -> errno_t;
387398
#[link_name = "_localtime64_s"]
388399
pub fn localtime_s(tmDest: *mut tm, sourceTime: *const time_t) -> crate::errno_t;
389400
#[link_name = "_time64"]
390401
pub fn time(destTime: *mut time_t) -> time_t;
402+
#[link_name = "_tzset"]
403+
pub fn tzset();
391404
#[link_name = "_chmod"]
392405
pub fn chmod(path: *const c_char, mode: c_int) -> c_int;
393406
#[link_name = "_wchmod"]

0 commit comments

Comments
 (0)