Skip to content

Commit 6ca151e

Browse files
committed
Auto merge of #1956 - JohnTitor:time64, r=JohnTitor
Add a deprecation note to `time_t` on musl cc #1848
2 parents 229b109 + d40c7eb commit 6ca151e

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/unix/linux_like/linux/musl/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
pub type pthread_t = *mut ::c_void;
22
pub type clock_t = c_long;
3+
#[deprecated(
4+
since = "0.2.80",
5+
note = "This type is changed to 64-bit in musl 1.2.0, \
6+
we'll follow that change in the future release. \
7+
See #1848 for more info."
8+
)]
39
pub type time_t = c_long;
410
pub type suseconds_t = c_long;
511
pub type ino_t = u64;

src/unix/mod.rs

+10-3
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)