Skip to content

Commit bbf53a1

Browse files
authored
Merge pull request rust-lang#337 from ParadoxSpiral/master
Add setlocale and wsetlocale for Windows
2 parents b065b3c + aff822e commit bbf53a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/windows.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ pub const S_IEXEC: ::c_int = 64;
9898
pub const S_IWRITE: ::c_int = 128;
9999
pub const S_IREAD: ::c_int = 256;
100100

101+
pub const LC_ALL: ::c_int = 0;
102+
pub const LC_COLLATE: ::c_int = 1;
103+
pub const LC_CTYPE: ::c_int = 2;
104+
pub const LC_MONETARY: ::c_int = 3;
105+
pub const LC_NUMERIC: ::c_int = 4;
106+
pub const LC_TIME: ::c_int = 5;
107+
101108
#[cfg(target_env = "msvc")] // " if " -- appease style checker
102109
#[link(name = "msvcrt")]
103110
extern {}
@@ -179,4 +186,8 @@ extern {
179186
pub fn get_osfhandle(fd: ::c_int) -> ::intptr_t;
180187
#[link_name = "_open_osfhandle"]
181188
pub fn open_osfhandle(osfhandle: ::intptr_t, flags: ::c_int) -> ::c_int;
189+
pub fn setlocale(category: ::c_int, locale: *const c_char) -> *mut c_char;
190+
#[link_name = "_wsetlocale"]
191+
pub fn wsetlocale(category: ::c_int,
192+
locale: *const wchar_t) -> *mut wchar_t;
182193
}

0 commit comments

Comments
 (0)