Skip to content

Commit 998e886

Browse files
committed
Auto merge of #2964 - devnexen:win32_putenv, r=JohnTitor
adds putenv call to win32. closes #2926.
2 parents 937aeaa + 44450fe commit 998e886

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

libc-test/semver/windows.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ popen
261261
printf
262262
ptrdiff_t
263263
putchar
264+
putenv
265+
putenv_s
264266
puts
265267
raise
266268
rand
@@ -340,6 +342,8 @@ wexecve
340342
wexecvp
341343
wexecvpe
342344
wopen
345+
wputenv
346+
wputenv_s
343347
write
344348
wrmdir
345349
wsetlocale

src/windows/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,14 @@ extern "C" {
509509
pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void;
510510
#[link_name = "_aligned_free"]
511511
pub fn aligned_free(ptr: *mut ::c_void);
512+
#[link_name = "_putenv"]
513+
pub fn putenv(envstring: *const ::c_char) -> ::c_int;
514+
#[link_name = "_wputenv"]
515+
pub fn wputenv(envstring: *const ::wchar_t) -> ::c_int;
516+
#[link_name = "_putenv_s"]
517+
pub fn putenv_s(envstring: *const ::c_char, value_string: *const ::c_char) -> ::errno_t;
518+
#[link_name = "_wputenv_s"]
519+
pub fn wputenv_s(envstring: *const ::wchar_t, value_string: *const ::wchar_t) -> ::errno_t;
512520
}
513521

514522
extern "system" {

0 commit comments

Comments
 (0)