diff options
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); |
