From f741fb8fcd5c5fdd0a64936cc606f041f530eabf Mon Sep 17 00:00:00 2001 From: cyan4973 Date: Tue, 26 Jun 2018 01:22:45 -0700 Subject: [PATCH] minor fixes for MSYS2 compilation --- programs/platform.h | 5 ++++- programs/util.h | 2 +- programs/zstdcli.c | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/programs/platform.h b/programs/platform.h index c86d289f..a550eb1a 100644 --- a/programs/platform.h +++ b/programs/platform.h @@ -96,7 +96,10 @@ extern "C" { /*-********************************************* * Detect if isatty() and fileno() are available ************************************************/ -#if (defined(__linux__) && (PLATFORM_POSIX_VERSION >= 1)) || (PLATFORM_POSIX_VERSION >= 200112L) || defined(__DJGPP__) +#if (defined(__linux__) && (PLATFORM_POSIX_VERSION >= 1)) \ + || (PLATFORM_POSIX_VERSION >= 200112L) \ + || defined(__DJGPP__) \ + || defined(__MSYS__) # include /* isatty */ # define IS_CONSOLE(stdStream) isatty(fileno(stdStream)) #elif defined(MSDOS) || defined(OS2) || defined(__CYGWIN__) diff --git a/programs/util.h b/programs/util.h index e88d2014..4392a5bd 100644 --- a/programs/util.h +++ b/programs/util.h @@ -513,7 +513,7 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_t* pos, char** bufEnd, int followLinks) { - (void)bufStart; (void)bufEnd; (void)pos; + (void)bufStart; (void)bufEnd; (void)pos; (void)followLinks; UTIL_DISPLAYLEVEL(1, "Directory %s ignored (compiled without _WIN32 or _POSIX_C_SOURCE)\n", dirName); return 0; } diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 6b6a9352..1af5f26f 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -761,8 +761,11 @@ int main(int argCount, const char* argv[]) nbWorkers = UTIL_countPhysicalCores(); DISPLAYLEVEL(3, "Note: %d physical core(s) detected \n", nbWorkers); } +#else + (void)singleThread; #endif +#ifdef UTIL_HAS_CREATEFILELIST g_utilDisplayLevel = g_displayLevel; if (!followLinks) { unsigned u; @@ -775,7 +778,6 @@ int main(int argCount, const char* argv[]) } filenameIdx = fileNamesNb; } -#ifdef UTIL_HAS_CREATEFILELIST if (recursive) { /* at this stage, filenameTable is a list of paths, which can contain both files and directories */ extendedFileList = UTIL_createFileList(filenameTable, filenameIdx, &fileNamesBuf, &fileNamesNb, followLinks); if (extendedFileList) { @@ -786,6 +788,8 @@ int main(int argCount, const char* argv[]) filenameIdx = fileNamesNb; } } +#else + (void)followLinks; #endif if (operation == zom_list) {