Skip to content

Commit c230681

Browse files
committed
Add getenv
1 parent b4e6de8 commit c230681

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

docs/tcc-wasm.wasm

-37 Bytes
Binary file not shown.

tcc-wasm.wasm

-37 Bytes
Binary file not shown.

zig/tcc-wasm.zig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ export fn strlen(s: [*:0]const u8) callconv(.C) usize {
144144
return std.mem.len(s);
145145
}
146146

147+
pub export fn getenv(_: c_int) ?[*]u8 {
148+
return null;
149+
}
150+
147151
///////////////////////////////////////////////////////////////////////////////
148152
/// Fix the Missing Variables
149153
pub export var errno: c_int = 0;
@@ -196,9 +200,6 @@ pub export fn fwrite(_: c_int) c_int {
196200
pub export fn getcwd(_: c_int) c_int {
197201
@panic("TODO: getcwd");
198202
}
199-
pub export fn getenv(_: c_int) c_int {
200-
@panic("TODO: getenv");
201-
}
202203
pub export fn gettimeofday(_: c_int) c_int {
203204
@panic("TODO: gettimeofday");
204205
}

0 commit comments

Comments
 (0)