]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
minor fixes for MSYS2 compilation 1208/head
authorcyan4973 <yann.collet.73@gmail.com>
Tue, 26 Jun 2018 08:22:45 +0000 (01:22 -0700)
committercyan4973 <yann.collet.73@gmail.com>
Tue, 26 Jun 2018 08:22:45 +0000 (01:22 -0700)
programs/platform.h
programs/util.h
programs/zstdcli.c

index c86d289f5414e990b7bcf78c628dc64aae168d2e..a550eb1a3957be2823bc1d567af67b3232fb92cf 100644 (file)
@@ -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 <unistd.h>   /* isatty */
 #  define IS_CONSOLE(stdStream) isatty(fileno(stdStream))
 #elif defined(MSDOS) || defined(OS2) || defined(__CYGWIN__)
index e88d20146e6726451aa511ba4b3da772f87377a2..4392a5bd0ecbb9fa1870c8f03cc5f9e4e4bc804f 100644 (file)
@@ -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;
 }
index 6b6a93528f6d10fc0469f5ffd65f350bed88099d..1af5f26fa70447982028771877129885bef31e3c 100644 (file)
@@ -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) {