summaryrefslogtreecommitdiffstats
path: root/programs/lz4cli.c
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2016-12-22 10:58:29 (GMT)
committerGitHub <noreply@github.com>2016-12-22 10:58:29 (GMT)
commitb41f9bb132e8207999e89d01925e202da98b7649 (patch)
tree4632c6d377ee39fe9bc5011191824360fe7b3990 /programs/lz4cli.c
parent7eb16d97d238e2b98f1e6453ed6ad64058cb99c1 (diff)
parentfea95c156761ee10d32a4f12105ebd90c67d4f47 (diff)
downloadlz4-b41f9bb132e8207999e89d01925e202da98b7649.zip
lz4-b41f9bb132e8207999e89d01925e202da98b7649.tar.gz
lz4-b41f9bb132e8207999e89d01925e202da98b7649.tar.bz2
Merge pull request #292 from inikep/dev
improved POSIX
Diffstat (limited to 'programs/lz4cli.c')
-rw-r--r--programs/lz4cli.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index 80d84a1..cf91a99 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -39,17 +39,11 @@
/* #define ENABLE_LZ4C_LEGACY_OPTIONS */
-/**************************************
-* Compiler Options
-***************************************/
-/* cf. http://man7.org/linux/man-pages/man7/feature_test_macros.7.html */
-#define _XOPEN_VERSION 600 /* POSIX.2001, for fileno() within <stdio.h> on unix */
-
-
/****************************
* Includes
*****************************/
-#include "util.h" /* Compiler options, UTIL_HAS_CREATEFILELIST */
+#include "platform.h" /* Compiler options, IS_CONSOLE */
+#include "util.h" /* UTIL_HAS_CREATEFILELIST, UTIL_createFileList */
#include <stdio.h> /* fprintf, getchar */
#include <stdlib.h> /* exit, calloc, free */
#include <string.h> /* strcmp, strlen */
@@ -59,20 +53,6 @@
#include "lz4.h" /* LZ4_VERSION_STRING */
-/*-************************************
-* OS-specific Includes
-**************************************/
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || (defined(__APPLE__) && defined(__MACH__)) || defined(__DJGPP__) /* https://sourceforge.net/p/predef/wiki/OperatingSystems/ */
-# include <unistd.h> /* isatty */
-# define IS_CONSOLE(stdStream) isatty(fileno(stdStream))
-#elif defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
-# include <io.h> /* _isatty */
-# define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
-#else
-# define IS_CONSOLE(stdStream) 0
-#endif
-
-
/*****************************
* Constants
******************************/
@@ -518,6 +498,18 @@ int main(int argc, const char** argv)
}
DISPLAYLEVEL(3, WELCOME_MESSAGE);
+#ifdef _POSIX_C_SOURCE
+ DISPLAYLEVEL(4, "_POSIX_C_SOURCE defined: %ldL\n", (long) _POSIX_C_SOURCE);
+#endif
+#ifdef _POSIX_VERSION
+ DISPLAYLEVEL(4, "_POSIX_VERSION defined: %ldL\n", (long) _POSIX_VERSION);
+#endif
+#ifdef PLATFORM_POSIX_VERSION
+ DISPLAYLEVEL(4, "PLATFORM_POSIX_VERSION defined: %ldL\n", (long) PLATFORM_POSIX_VERSION);
+#endif
+#ifdef _FILE_OFFSET_BITS
+ DISPLAYLEVEL(4, "_FILE_OFFSET_BITS defined: %ldL\n", (long) _FILE_OFFSET_BITS);
+#endif
if ((mode == om_compress) || (mode == om_bench)) DISPLAYLEVEL(4, "Blocks size : %i KB\n", (U32)(blockSize>>10));
if (multiple_inputs) {