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/utils/utils.c | |
| parent | a2804ffe502ec31fc3bf561b7e59c25622b15e19 (diff) | |
| parent | 555141e35166c7f7d98c16f6f95fde8e57a651c2 (diff) | |
Merge branch 'z-libs:main' into main
Diffstat (limited to 'src/utils/utils.c')
| -rw-r--r-- | src/utils/utils.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/utils/utils.c b/src/utils/utils.c index 159326e..56a7690 100644 --- a/src/utils/utils.c +++ b/src/utils/utils.c @@ -671,14 +671,17 @@ void scan_build_directives(ParserContext *ctx, const char *src) { printf("[zprep] Downloading %s...\n", filename); char cmd[8192]; -#ifdef _WIN32 - // On Windows, try curl which is often built-in now - sprintf(cmd, "curl -s -L \"%s\" -o \"%s\"", url, filename); -#else - // Try wget, then curl. - sprintf(cmd, "wget -q \"%s\" -O \"%s\" || curl -s -L \"%s\" -o \"%s\"", url, - filename, url, filename); -#endif + if (z_is_windows()) + { + // On Windows, try curl which is often built-in now + sprintf(cmd, "curl -s -L \"%s\" -o \"%s\"", url, filename); + } + else + { + // Try wget, then curl. + sprintf(cmd, "wget -q \"%s\" -O \"%s\" || curl -s -L \"%s\" -o \"%s\"", url, + filename, url, filename); + } if (system(cmd) != 0) { zwarn("Failed to download %s", url); @@ -693,11 +696,12 @@ void scan_build_directives(ParserContext *ctx, const char *src) libs++; } -#ifdef _WIN32 - zwarn("pkg-config is usually not available on Windows. Build directive " - "'pkg-config:%s' might fail.", - libs); -#endif + if (z_is_windows()) + { + zwarn("pkg-config is usually not available on Windows. Build directive " + "'pkg-config:%s' might fail.", + libs); + } char cmd[4096]; sprintf(cmd, "pkg-config --cflags %s", libs); |
