Skip to content

Commit 50a2acf

Browse files
authored
Merge pull request #4427 from arihant2math/windows-time
Add more windows time.h functions
2 parents ebb82a1 + 35a32a7 commit 50a2acf

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
@@ -374,12 +374,25 @@ extern "C" {
374374
pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t;
375375
pub fn raise(signum: c_int) -> c_int;
376376

377+
pub fn clock() -> clock_t;
378+
pub fn ctime(sourceTime: *const time_t) -> *mut c_char;
379+
pub fn difftime(timeEnd: time_t, timeStart: time_t) -> c_double;
377380
#[link_name = "_gmtime64_s"]
378381
pub fn gmtime_s(destTime: *mut tm, srcTime: *const time_t) -> c_int;
382+
#[link_name = "_get_daylight"]
383+
pub fn get_daylight(hours: *mut c_int) -> errno_t;
384+
#[link_name = "_get_dstbias"]
385+
pub fn get_dstbias(seconds: *mut c_long) -> errno_t;
386+
#[link_name = "_get_timezone"]
387+
pub fn get_timezone(seconds: *mut c_long) -> errno_t;
388+
#[link_name = "_get_tzname"]
389+
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;
379390
#[link_name = "_localtime64_s"]
380391
pub fn localtime_s(tmDest: *mut tm, sourceTime: *const time_t) -> crate::errno_t;
381392
#[link_name = "_time64"]
382393
pub fn time(destTime: *mut time_t) -> time_t;
394+
#[link_name = "_tzset"]
395+
pub fn tzset();
383396
#[link_name = "_chmod"]
384397
pub fn chmod(path: *const c_char, mode: c_int) -> c_int;
385398
#[link_name = "_wchmod"]

0 commit comments

Comments
 (0)