Skip to content

Commit c61f507

Browse files
committed
Fix return types and undefined symbols
freelocale is a weird beast: some of the bsds have it returning an int, everything else has it returning void. *shrug*
1 parent 1925ab6 commit c61f507

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -369,19 +369,6 @@ pub const CRNCYSTR: ::nl_item = 56;
369369

370370
pub const D_MD_ORDER: ::nl_item = 57;
371371

372-
pub const ALTMON_1: ::nl_item = 58;
373-
pub const ALTMON_2: ::nl_item = 59;
374-
pub const ALTMON_3: ::nl_item = 60;
375-
pub const ALTMON_4: ::nl_item = 61;
376-
pub const ALTMON_5: ::nl_item = 62;
377-
pub const ALTMON_6: ::nl_item = 63;
378-
pub const ALTMON_7: ::nl_item = 64;
379-
pub const ALTMON_8: ::nl_item = 65;
380-
pub const ALTMON_9: ::nl_item = 66;
381-
pub const ALTMON_10: ::nl_item = 67;
382-
pub const ALTMON_11: ::nl_item = 68;
383-
pub const ALTMON_12: ::nl_item = 69;
384-
385372
pub const EXIT_FAILURE: ::c_int = 1;
386373
pub const EXIT_SUCCESS: ::c_int = 0;
387374
pub const RAND_MAX: ::c_int = 2147483647;
@@ -1124,8 +1111,8 @@ extern {
11241111
termp: *mut termios,
11251112
winp: *mut ::winsize) -> ::pid_t;
11261113
pub fn duplocale(base: ::locale_t) -> ::locale_t;
1127-
pub fn freelocale(loc: ::locale_t);
1128-
pub fn localeconv_l(loc: ::locale_t) -> *mut ::locale_t;
1114+
pub fn freelocale(loc: ::locale_t) -> ::c_int;
1115+
pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
11291116
pub fn newlocale(mask: ::c_int,
11301117
locale: *const ::c_char,
11311118
base: ::locale_t) -> ::locale_t;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,9 @@ extern {
713713
timeout: *const ::timespec) -> ::c_int;
714714
pub fn sigwaitinfo(set: *const sigset_t,
715715
info: *mut siginfo_t) -> ::c_int;
716+
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
716717
pub fn duplocale(base: ::locale_t) -> ::locale_t;
717-
pub fn freelocale(loc: ::locale_t);
718+
pub fn freelocale(loc: ::locale_t) -> ::c_int;
718719
pub fn newlocale(mask: ::c_int,
719720
locale: *const ::c_char,
720721
base: ::locale_t) -> ::locale_t;

src/unix/bsd/openbsdlike/bitrig.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,9 @@ extern {
305305
newp: *mut ::c_void,
306306
newlen: ::size_t)
307307
-> ::c_int;
308+
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
308309
pub fn duplocale(base: ::locale_t) -> ::locale_t;
309-
pub fn freelocale(loc: ::locale_t);
310+
pub fn freelocale(loc: ::locale_t) -> ::c_int;
310311
pub fn newlocale(mask: ::c_int,
311312
locale: *const ::c_char,
312313
base: ::locale_t) -> ::locale_t;

src/unix/bsd/openbsdlike/netbsd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ extern {
427427
info: *mut siginfo_t) -> ::c_int;
428428
pub fn duplocale(base: ::locale_t) -> ::locale_t;
429429
pub fn freelocale(loc: ::locale_t);
430-
pub fn localeconv_l(loc: ::locale_t) -> *mut ::locale_t;
430+
pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
431431
pub fn newlocale(mask: ::c_int,
432432
locale: *const ::c_char,
433433
base: ::locale_t) -> ::locale_t;

src/unix/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,6 @@ extern {
718718
pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
719719
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
720720
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
721-
pub fn nl_langinfo_l(item: ::nl_item, locale: locale_t) -> *mut ::c_char;
722721
}
723722

724723
cfg_if! {

src/unix/solaris/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ extern {
880880
buflen: ::size_t) -> *const passwd;
881881
pub fn readdir(dirp: *mut ::DIR) -> *const ::dirent;
882882
pub fn fdatasync(fd: ::c_int) -> ::c_int;
883+
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
883884
pub fn duplocale(base: ::locale_t) -> ::locale_t;
884885
pub fn freelocale(loc: ::locale_t);
885886
pub fn newlocale(mask: ::c_int,

0 commit comments

Comments
 (0)