aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-23 18:46:03 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-09-23 18:46:03 -0400
commit41b588547cd49673ff632ed0fc3210c76ff48b42 (patch)
treea1e44c3b10a1a004d95d9bc574dbfa985f488b39 /src
parent7fd164f196e5867594498d3600e5da1273ad5b6f (diff)
downloadzig-41b588547cd49673ff632ed0fc3210c76ff48b42.tar.gz
zig-41b588547cd49673ff632ed0fc3210c76ff48b42.zip
improvements to windows support
See #302
Diffstat (limited to 'src')
-rw-r--r--src/analyze.cpp4
-rw-r--r--src/os.hpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index e0d34be281..b20b7b3bd7 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -3189,6 +3189,8 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, Buf *a
if (is_pub) {
if (buf_eql_str(proto_name, "main")) {
g->have_pub_main = true;
+ g->windows_subsystem_windows = false;
+ g->windows_subsystem_console = true;
} else if (buf_eql_str(proto_name, "panic")) {
g->have_pub_panic = true;
}
@@ -3196,6 +3198,8 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, Buf *a
g->libc_link_lib != nullptr)
{
g->have_c_main = true;
+ g->windows_subsystem_windows = false;
+ g->windows_subsystem_console = true;
}
}
diff --git a/src/os.hpp b/src/os.hpp
index 2aefad4fa8..0d4e8d3dba 100644
--- a/src/os.hpp
+++ b/src/os.hpp
@@ -81,7 +81,7 @@ bool os_is_sep(uint8_t c);
#endif
#if defined(ZIG_OS_WINDOWS)
-#define ZIG_PRI_usize "Iu"
+#define ZIG_PRI_usize "I64u"
#define ZIG_PRI_u64 "I64u"
#define ZIG_PRI_llu "I64u"
#define ZIG_PRI_x64 "I64x"