diff options
author | bors <bors@rust-lang.org> | 2022-10-16 22:46:53 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2022-10-16 22:46:53 +0000 |
commit | 998e88630ebbdceda33774cd6531335254f9769b (patch) | |
tree | 4ace1408563183b9555784f68c7146434fae1c44 | |
parent | 937aeaafe4ddac1e0d1e5f3cc05d928685c68abb (diff) | |
parent | 44450feaff7e378f871932b6e7a013841e1a9cd9 (diff) | |
download | rust-libc-998e88630ebbdceda33774cd6531335254f9769b.tar.gz |
Auto merge of #2964 - devnexen:win32_putenv, r=JohnTitor
adds putenv call to win32.
closes #2926.
-rw-r--r-- | libc-test/semver/windows.txt | 4 | ||||
-rw-r--r-- | src/windows/mod.rs | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt index ddb97a8d8e..1ddf031b14 100644 --- a/libc-test/semver/windows.txt +++ b/libc-test/semver/windows.txt @@ -261,6 +261,8 @@ popen printf ptrdiff_t putchar +putenv +putenv_s puts raise rand @@ -340,6 +342,8 @@ wexecve wexecvp wexecvpe wopen +wputenv +wputenv_s write wrmdir wsetlocale diff --git a/src/windows/mod.rs b/src/windows/mod.rs index acb0de9895..916019b1f2 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -509,6 +509,14 @@ extern "C" { pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void; #[link_name = "_aligned_free"] pub fn aligned_free(ptr: *mut ::c_void); + #[link_name = "_putenv"] + pub fn putenv(envstring: *const ::c_char) -> ::c_int; + #[link_name = "_wputenv"] + pub fn wputenv(envstring: *const ::wchar_t) -> ::c_int; + #[link_name = "_putenv_s"] + pub fn putenv_s(envstring: *const ::c_char, value_string: *const ::c_char) -> ::errno_t; + #[link_name = "_wputenv_s"] + pub fn wputenv_s(envstring: *const ::wchar_t, value_string: *const ::wchar_t) -> ::errno_t; } extern "system" { |