]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
tools use platform.h
authorPrzemyslaw Skibinski <inikep@gmail.com>
Fri, 16 Dec 2016 13:24:01 +0000 (14:24 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Fri, 16 Dec 2016 13:24:01 +0000 (14:24 +0100)
programs/bench.c
programs/dibio.c
programs/fileio.c
programs/platform.h
programs/zstdcli.c
tests/datagencli.c
tests/fullbench.c
tests/paramgrill.c
zlibWrapper/examples/zwrapbench.c

index 9104ea89c9ced2f4e49e3cb960cee607ce49830f..f58f3e5c545f87919f63d31e669503502d368928 100644 (file)
@@ -11,7 +11,8 @@
 /* *************************************
 *  Includes
 ***************************************/
-#include "util.h"        /* Compiler options, UTIL_GetFileSize, UTIL_sleep */
+#include "platform.h"    /* Compiler options */
+#include "util.h"        /* UTIL_GetFileSize, UTIL_sleep */
 #include <stdlib.h>      /* malloc, free */
 #include <string.h>      /* memset */
 #include <stdio.h>       /* fprintf, fopen, ftello64 */
index a793669cb8fb6eef6475c7cd8eb50b0c5bfa2af0..74dc54055977eb28c39d04cc462b11f6492e0f01 100644 (file)
@@ -12,7 +12,8 @@
 /*-*************************************
 *  Includes
 ***************************************/
-#include "util.h"           /* Compiler options, UTIL_GetFileSize, UTIL_getTotalFileSize */
+#include "platform.h"       /* Compiler options */
+#include "util.h"           /* UTIL_GetFileSize, UTIL_getTotalFileSize */
 #include <stdlib.h>         /* malloc, free */
 #include <string.h>         /* memset */
 #include <stdio.h>          /* fprintf, fopen, ftello64 */
index a493e97c57461143ba58a05bcd83c6de0d5c3b62..2ff5947f4cbd79e61a87850d8c485e350235e835 100644 (file)
@@ -22,7 +22,8 @@
 /*-*************************************
 *  Includes
 ***************************************/
-#include "util.h"       /* Compiler options, UTIL_GetFileSize, _LARGEFILE64_SOURCE */
+#include "platform.h"   /* Compiler options */
+#include "util.h"       /* UTIL_GetFileSize, _LARGEFILE64_SOURCE */
 #include <stdio.h>      /* fprintf, fopen, fread, _fileno, stdin, stdout */
 #include <stdlib.h>     /* malloc, free */
 #include <string.h>     /* strcmp, strlen */
index 978db1db42c3044575f9479c0783d9175d42ad90..095e52b84230f805d75e7a1ba4ec377a8984d6bd 100644 (file)
@@ -30,7 +30,9 @@ extern "C" {
 #endif
 
 
-/* Unix Large Files support (>4GB) */
+/* **************************************
+*  Unix Large Files support (>4GB)
+****************************************/
 #if !defined(__LP64__)                                /* No point defining Large file for 64 bit */
 #  define _FILE_OFFSET_BITS 64                        /* turn off_t into a 64-bit type for ftello, fseeko */
 #  if defined(__sun__) && !defined(_LARGEFILE_SOURCE) /* Sun Solaris 32-bits requires specific definitions */
@@ -41,6 +43,12 @@ extern "C" {
 #endif
 
 
+/* ***********************************************************
+*  Detect POSIX version
+*  PLATFORM_POSIX_VERSION = 0 for non-Unix e.g. Windows
+*  PLATFORM_POSIX_VERSION = 1 for Unix-like
+*  PLATFORM_POSIX_VERSION > 1 is equal to found _POSIX_VERSION
+**************************************************************/
 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)) || defined(__midipix__))
        /* UNIX-style OS. ------------------------------------------- */
 #  if (defined(__APPLE__) && defined(__MACH__) || defined(__SVR4) || defined(_AIX) || defined(__hpux) \
@@ -53,6 +61,8 @@ extern "C" {
 #    include <unistd.h>  /* declares _POSIX_VERSION */
 #    if defined(_POSIX_VERSION)  /* POSIX compliant */
 #      define PLATFORM_POSIX_VERSION _POSIX_VERSION
+#    else
+#      define PLATFORM_POSIX_VERSION 1
 #    endif
 #  endif
 #endif
@@ -62,6 +72,7 @@ extern "C" {
 #endif
 
 
+
 #if defined (__cplusplus)
 }
 #endif
index 561730a5f70819ca67bd8ad7f81d5158ab02c05a..fa2956ca4cc65c1003ea72710d8d1c44a4db67b1 100644 (file)
@@ -23,7 +23,8 @@
 /*-************************************
 *  Dependencies
 **************************************/
-#include "util.h"     /* Compiler options, UTIL_HAS_CREATEFILELIST */
+#include "platform.h" /* Compiler options, PLATFORM_POSIX_VERSION */
+#include "util.h"     /* UTIL_HAS_CREATEFILELIST, UTIL_createFileList */
 #include <string.h>   /* strcmp, strlen */
 #include <errno.h>    /* errno */
 #include "fileio.h"
index 2f3ebc4d6863f29eb2de77a41d4fab6fc6a746d6..0729cdd0cc20b70fdc22bfb388fa18e274e951f7 100644 (file)
@@ -11,7 +11,7 @@
 /*-************************************
 *  Dependencies
 **************************************/
-#include "util.h"      /* Compiler options */
+#include "platform.h"  /* Compiler options */
 #include <stdio.h>     /* fprintf, stderr */
 #include "datagen.h"   /* RDG_generate */
 
index 233b4e931e4f479efdd432053fa2b78180c1ca60..e5547d08922930631eeb979d58a1fb19006c9738 100644 (file)
@@ -11,7 +11,8 @@
 /*_************************************
 *  Includes
 **************************************/
-#include "util.h"        /* Compiler options, UTIL_GetFileSize */
+#include "platform.h"    /* Compiler options */
+#include "util.h"        /* UTIL_GetFileSize */
 #include <stdlib.h>      /* malloc */
 #include <stdio.h>       /* fprintf, fopen, ftello64 */
 #include <time.h>        /* clock_t, clock, CLOCKS_PER_SEC */
index 5eabcba2b60b44ae9f901fda594c436e647da96b..19658fddb84a5447b6a0961d5277bcdd8ba988a4 100644 (file)
@@ -11,7 +11,8 @@
 /*-************************************
 *  Dependencies
 **************************************/
-#include "util.h"      /* Compiler options, UTIL_GetFileSize */
+#include "platform.h"  /* Compiler options */
+#include "util.h"      /* UTIL_GetFileSize */
 #include <stdlib.h>    /* malloc */
 #include <stdio.h>     /* fprintf, fopen, ftello64 */
 #include <string.h>    /* strcmp */
index e0aca00157a0d01328d638d372ad213fa76606da..c3968dba30f1cfaa6547373053ec4d47c6547d42 100644 (file)
@@ -11,7 +11,8 @@
 /* *************************************
 *  Includes
 ***************************************/
-#include "util.h"        /* Compiler options, UTIL_GetFileSize, UTIL_sleep */
+#include "platform.h"    /* Compiler options */
+#include "util.h"        /* UTIL_GetFileSize, UTIL_sleep */
 #include <stdlib.h>      /* malloc, free */
 #include <string.h>      /* memset */
 #include <stdio.h>       /* fprintf, fopen, ftello64 */