#How to see if program is running on Windows?

1 messages · Page 1 of 1 (latest)

vagrant isle
#

So in my program I do some input parsing, and if I'm running on Windows I need to remove the \r it puts in the end of input.
In see we would do this is a #ifdef, but how can I do this in Zig?
(How can I tell if I'm running on a linux machine or a window machine?)

devout marten
#
const builtin = @import("builtin");
...
if (builtin.os.tag == .windows)
vagrant isle
#

Thank you :)

#

Where can I find the documentation for that?

#

Found it!