Skip to content

Commit d40c7eb

Browse files
committed
Allow deprecated time_t on musl
1 parent e471884 commit d40c7eb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/unix/mod.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,23 +1315,33 @@ extern "C" {
13151315
pub fn res_init() -> ::c_int;
13161316

13171317
#[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
1318+
#[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t`
13181319
pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
13191320
#[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")]
1321+
#[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t`
13201322
pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
13211323
#[cfg_attr(
13221324
all(target_os = "macos", target_arch = "x86"),
13231325
link_name = "mktime$UNIX2003"
13241326
)]
13251327
#[cfg_attr(target_os = "netbsd", link_name = "__mktime50")]
1328+
#[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t`
13261329
pub fn mktime(tm: *mut tm) -> time_t;
13271330
#[cfg_attr(target_os = "netbsd", link_name = "__time50")]
1331+
#[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t`
13281332
pub fn time(time: *mut time_t) -> time_t;
13291333
#[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")]
1334+
#[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t`
13301335
pub fn gmtime(time_p: *const time_t) -> *mut tm;
13311336
#[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
1337+
#[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t`
13321338
pub fn localtime(time_p: *const time_t) -> *mut tm;
13331339
#[cfg_attr(target_os = "netbsd", link_name = "__difftime50")]
1340+
#[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t`
13341341
pub fn difftime(time1: time_t, time0: time_t) -> ::c_double;
1342+
#[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
1343+
#[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t`
1344+
pub fn timegm(tm: *mut ::tm) -> time_t;
13351345

13361346
#[cfg_attr(target_os = "netbsd", link_name = "__mknod50")]
13371347
#[cfg_attr(
@@ -1446,9 +1456,6 @@ extern "C" {
14461456
#[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")]
14471457
pub fn sigpending(set: *mut sigset_t) -> ::c_int;
14481458

1449-
#[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
1450-
pub fn timegm(tm: *mut ::tm) -> time_t;
1451-
14521459
pub fn sysconf(name: ::c_int) -> ::c_long;
14531460

14541461
pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;

0 commit comments

Comments
 (0)