diff options
| author | iryuken <eshwarsajja20@gmail.com> | 2026-01-26 00:59:44 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-26 00:59:44 +0530 |
| commit | 5066e09fcac1a679d30afb89af1385352e9b5c60 (patch) | |
| tree | a4d564cbd7707a1c565135d630157b74b742f0a3 /src/main.c | |
| parent | a2804ffe502ec31fc3bf561b7e59c25622b15e19 (diff) | |
| parent | 555141e35166c7f7d98c16f6f95fde8e57a651c2 (diff) | |
Merge branch 'z-libs:main' into main
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 39 |
1 files changed, 23 insertions, 16 deletions
@@ -56,11 +56,14 @@ void print_usage() int main(int argc, char **argv) { memset(&g_config, 0, sizeof(g_config)); -#ifdef __COSMOPOLITAN__ - strcpy(g_config.cc, "cosmocc"); -#else - strcpy(g_config.cc, "gcc"); -#endif + if (z_is_windows()) + { + strcpy(g_config.cc, "gcc.exe"); + } + else + { + strcpy(g_config.cc, "gcc"); + } if (argc < 2) { @@ -346,14 +349,15 @@ int main(int argc, char **argv) const char *thread_flag = g_parser_ctx->has_async ? "-lpthread" : ""; const char *math_flag = "-lm"; -#ifdef _WIN32 - // Windows might use different flags or none for math/threads - math_flag = ""; - if (g_parser_ctx->has_async) + if (z_is_windows()) { - thread_flag = ""; + // Windows might use different flags or none for math/threads + math_flag = ""; + if (g_parser_ctx->has_async) + { + thread_flag = ""; + } } -#endif // If using cosmocc, it handles these usually, but keeping them is okay for Linux targets @@ -386,11 +390,14 @@ int main(int argc, char **argv) if (g_config.mode_run) { char run_cmd[2048]; -#ifdef _WIN32 - sprintf(run_cmd, "%s", outfile); -#else - sprintf(run_cmd, "./%s", outfile); -#endif + if (z_is_windows()) + { + sprintf(run_cmd, "%s", outfile); + } + else + { + sprintf(run_cmd, "./%s", outfile); + } ret = system(run_cmd); remove(outfile); zptr_plugin_mgr_cleanup(); |
