]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Move #includes out of `extern "C"` blocks
authorVictor Zhang <csv@meta.com>
Wed, 18 Dec 2024 01:55:07 +0000 (17:55 -0800)
committerVictor Zhang <csv@meta.com>
Wed, 18 Dec 2024 01:55:07 +0000 (17:55 -0800)
Do some include shuffling for `**.h` files within lib, programs, tests, and zlibWrapper.
`lib/legacy` and `lib/deprecated` are untouched.
`#include`s within `extern "C"` blocks in .cpp files are untouched.

todo: shuffling for `xxhash.h`

27 files changed:
contrib/seekable_format/zstd_seekable.h
lib/common/bitstream.h
lib/common/debug.h
lib/common/error_private.h
lib/common/fse.h
lib/common/huf.h
lib/common/mem.h
lib/common/pool.h
lib/common/threading.h
lib/common/zstd_trace.h
lib/compress/zstd_double_fast.h
lib/compress/zstd_fast.h
lib/compress/zstd_lazy.h
lib/compress/zstd_ldm.h
lib/compress/zstd_opt.h
lib/compress/zstdmt_compress.h
lib/zdict.h
lib/zstd.h
programs/benchfn.h
programs/benchzstd.h
programs/fileio_asyncio.h
programs/fileio_common.h
programs/platform.h
programs/timefn.h
programs/util.c
programs/util.h
zlibWrapper/zstd_zlibwrapper.h

index a0e5e3573d0bc5d0364eec057f43257141b25459..b1f83d0e0a132dde4fd86f5a89582dec48a46b22 100644 (file)
@@ -1,13 +1,13 @@
 #ifndef SEEKABLE_H
 #define SEEKABLE_H
 
+#include <stdio.h>
+#include "zstd.h"   /* ZSTDLIB_API */
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
-#include <stdio.h>
-#include "zstd.h"   /* ZSTDLIB_API */
-
 
 #define ZSTD_seekTableFooterSize 9
 
index 676044989c9f3d16d45b0bbc54f53bae7328ae0c..bce91e8018c01f6b4a7c98b0065cda2c2de93dbc 100644 (file)
@@ -14,9 +14,6 @@
 #ifndef BITSTREAM_H_MODULE
 #define BITSTREAM_H_MODULE
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 /*
 *  This API consists of small unitary functions, which must be inlined for best performance.
 *  Since link-time-optimization is not available for all compilers,
@@ -32,7 +29,6 @@ extern "C" {
 #include "error_private.h"  /* error codes and messages */
 #include "bits.h"           /* ZSTD_highbit32 */
 
-
 /*=========================================
 *  Target specific
 =========================================*/
@@ -44,6 +40,10 @@ extern "C" {
 #  endif
 #endif
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 #define STREAM_ACCUMULATOR_MIN_32  25
 #define STREAM_ACCUMULATOR_MIN_64  57
 #define STREAM_ACCUMULATOR_MIN    ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))
index a16b69e57439387f3061caeaa66d9c38e79f8274..8ef37a9087acdb3fecea8bc15b1e49bb26d2f7cd 100644 (file)
 #ifndef DEBUG_H_12987983217
 #define DEBUG_H_12987983217
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 
 /* static assert is triggered at compile time, leaving no runtime artefact.
  * static assert only works with compile-time constants.
@@ -75,9 +71,12 @@ extern "C" {
 #  endif
 #endif
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 #if (DEBUGLEVEL>=2)
 #  define ZSTD_DEPS_NEED_IO
-#  include "zstd_deps.h"
 extern int g_debuglevel; /* the variable is only declared,
                             it actually lives in debug.c,
                             and is shared by the whole process.
index 0156010c74593176073f91e721fdb9d4b1376baa..06233aaa8ebeea995d61fbc428c4ce73bf303d34 100644 (file)
 #ifndef ERROR_H_MODULE
 #define ERROR_H_MODULE
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
 /* ****************************************
 *  Dependencies
 ******************************************/
@@ -26,6 +21,9 @@ extern "C" {
 #include "debug.h"
 #include "zstd_deps.h"       /* size_t */
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
 
 /* ****************************************
 *  Compiler-specific
index 2ae128e60db4c43dbc1559647bd78bae41cf9a1c..4c41b06ef2d9b277056d134997adacf1253d386b 100644 (file)
  * in the COPYING file in the root directory of this source tree).
  * You may select, at your option, one of the above-listed licenses.
 ****************************************************************** */
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #ifndef FSE_H
 #define FSE_H
 
@@ -25,6 +20,14 @@ extern "C" {
 ******************************************/
 #include "zstd_deps.h"    /* size_t, ptrdiff_t */
 
+#if defined(FSE_STATIC_LINKING_ONLY) && !defined(FSE_H_FSE_STATIC_LINKING_ONLY)
+#define FSE_H_FSE_STATIC_LINKING_ONLY
+#include "bitstream.h"
+#endif 
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
 
 /*-*****************************************
 *  FSE_PUBLIC_API : control library symbols visibility
@@ -233,9 +236,6 @@ If there is an error, the function will return an error code, which can be teste
 #if defined(FSE_STATIC_LINKING_ONLY) && !defined(FSE_H_FSE_STATIC_LINKING_ONLY)
 #define FSE_H_FSE_STATIC_LINKING_ONLY
 
-/* *** Dependency *** */
-#include "bitstream.h"
-
 
 /* *****************************************
 *  Static allocation
index 99bf85d6f4ed2a6ad02b911b5721eed979179147..bfcec4a812727bdabaede92eadea573928040593 100644 (file)
  * You may select, at your option, one of the above-listed licenses.
 ****************************************************************** */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #ifndef HUF_H_298734234
 #define HUF_H_298734234
 
@@ -25,6 +21,9 @@ extern "C" {
 #define FSE_STATIC_LINKING_ONLY
 #include "fse.h"
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
 
 /* ***   Tool functions *** */
 #define HUF_BLOCKSIZE_MAX (128 * 1024)   /**< maximum input size for a single block compressed with HUF_compress */
index a02141c9d496f36edc6480a6de44ce36a2cb9abb..1b0a946ad155a6e01b45dc5ffaaa448c3e1192e4 100644 (file)
 #ifndef MEM_H_MODULE
 #define MEM_H_MODULE
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /*-****************************************
 *  Dependencies
 ******************************************/
@@ -77,6 +73,10 @@ extern "C" {
 #endif
 
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 /*-**************************************************************
 *  Memory I/O API
 *****************************************************************/
index cca4de73a830ad8fd1e3cb407ef0a94e07bb5b3a..d34082dc1fcf80b95b40acd467a1d90f024b811b 100644 (file)
 #ifndef POOL_H
 #define POOL_H
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 
 #include "zstd_deps.h"
 #define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_customMem */
 #include "../zstd.h"
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 typedef struct POOL_ctx_s POOL_ctx;
 
 /*! POOL_create() :
index fb5c1c8787343d6de1f1075d41e9601ca90b1f91..25448548d095864ee2532f60e8aa4e371e5e8dba 100644 (file)
 
 #include "debug.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #if defined(ZSTD_MULTITHREAD) && defined(_WIN32)
 
 /**
@@ -60,6 +56,11 @@ extern "C" {
 #define ZSTD_pthread_cond_signal(a)     WakeConditionVariable((a))
 #define ZSTD_pthread_cond_broadcast(a)  WakeAllConditionVariable((a))
 
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 /* ZSTD_pthread_create() and ZSTD_pthread_join() */
 typedef HANDLE ZSTD_pthread_t;
 
@@ -73,10 +74,19 @@ int ZSTD_pthread_join(ZSTD_pthread_t thread);
  */
 
 
+#if defined (__cplusplus)
+}
+#endif
+
 #elif defined(ZSTD_MULTITHREAD)    /* posix assumed ; need a better detection method */
 /* ===   POSIX Systems   === */
 #  include <pthread.h>
 
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 #if DEBUGLEVEL < 1
 
 #define ZSTD_pthread_mutex_t            pthread_mutex_t
@@ -123,9 +133,18 @@ int ZSTD_pthread_cond_destroy(ZSTD_pthread_cond_t* cond);
 
 #endif
 
+#if defined (__cplusplus)
+}
+#endif
+
 #else  /* ZSTD_MULTITHREAD not defined */
 /* No multithreading support */
 
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 typedef int ZSTD_pthread_mutex_t;
 #define ZSTD_pthread_mutex_init(a, b)   ((void)(a), (void)(b), 0)
 #define ZSTD_pthread_mutex_destroy(a)   ((void)(a))
index 173d63fb1bc1c0e74c940efcdf69311a81f65dd2..b9187079c5d26d4e1131d093e7a0bf39bda3dfcf 100644 (file)
 #ifndef ZSTD_TRACE_H
 #define ZSTD_TRACE_H
 
+#include <stddef.h>
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
-#include <stddef.h>
-
 /* weak symbol support
  * For now, enable conservatively:
  * - Only GNUC
index ce6ed8c97fd7913714a8cc3d172f652b5f2d80e3..ae66f31427927c893cc193ca033a951f80f5b917 100644 (file)
 #ifndef ZSTD_DOUBLE_FAST_H
 #define ZSTD_DOUBLE_FAST_H
 
+#include "../common/mem.h"      /* U32 */
+#include "zstd_compress_internal.h"     /* ZSTD_CCtx, size_t */
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
-#include "../common/mem.h"      /* U32 */
-#include "zstd_compress_internal.h"     /* ZSTD_CCtx, size_t */
-
 #ifndef ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR
 
 void ZSTD_fillDoubleHashTable(ZSTD_matchState_t* ms,
index 9e4236b47280ee65c7fb7884772cda91d55d5e51..f92cf35b9616fcfa0b92e0d1557659f7de3f5f28 100644 (file)
 #ifndef ZSTD_FAST_H
 #define ZSTD_FAST_H
 
+#include "../common/mem.h"      /* U32 */
+#include "zstd_compress_internal.h"
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
-#include "../common/mem.h"      /* U32 */
-#include "zstd_compress_internal.h"
-
 void ZSTD_fillHashTable(ZSTD_matchState_t* ms,
                         void const* end, ZSTD_dictTableLoadMethod_e dtlm,
                         ZSTD_tableFillPurpose_e tfp);
index 3635813bddf80a838c8b878837bd8b0a35df2f0e..bec17b1247e41c2c56b6fdee8923b0935a4ee147 100644 (file)
 #ifndef ZSTD_LAZY_H
 #define ZSTD_LAZY_H
 
+#include "zstd_compress_internal.h"
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
-#include "zstd_compress_internal.h"
-
 /**
  * Dedicated Dictionary Search Structure bucket log. In the
  * ZSTD_dedicatedDictSearch mode, the hashTable has
index f147021d2969aea891776b75bd99bf3d6511d9b7..847c2befb1ee03044247c4b2e0dea4a5640f7944 100644 (file)
 #ifndef ZSTD_LDM_H
 #define ZSTD_LDM_H
 
+#include "zstd_compress_internal.h"   /* ldmParams_t, U32 */
+#include "../zstd.h"   /* ZSTD_CCtx, size_t */
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
-#include "zstd_compress_internal.h"   /* ldmParams_t, U32 */
-#include "../zstd.h"   /* ZSTD_CCtx, size_t */
-
 /*-*************************************
 *  Long distance matching
 ***************************************/
index d4e7113157256bf3effd8e2d95e215de4dee1d38..7ce6fdae7b17c105bfba432c5f6b694a876e7a1a 100644 (file)
 #ifndef ZSTD_OPT_H
 #define ZSTD_OPT_H
 
+#include "zstd_compress_internal.h"
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
-#include "zstd_compress_internal.h"
-
 #if !defined(ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR) \
  || !defined(ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR) \
  || !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR)
index ed4dc0e99df3a7aac3f5daae2b9ae6cc9b7ea66d..9a58b5ad30d0e47101104e445d6a048c0e7fc784 100644 (file)
  #ifndef ZSTDMT_COMPRESS_H
  #define ZSTDMT_COMPRESS_H
 
+/* ===   Dependencies   === */
+#include "../common/zstd_deps.h"   /* size_t */
+#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_parameters */
+#include "../zstd.h"            /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTDLIB_API */
+
  #if defined (__cplusplus)
  extern "C" {
  #endif
  *        otherwise ZSTDMT_createCCtx*() will fail.
  */
 
-/* ===   Dependencies   === */
-#include "../common/zstd_deps.h"   /* size_t */
-#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_parameters */
-#include "../zstd.h"            /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTDLIB_API */
-
-
 /* ===   Constants   === */
 #ifndef ZSTDMT_NBWORKERS_MAX /* a different value can be selected at compile time */
 #  define ZSTDMT_NBWORKERS_MAX ((sizeof(void*)==4) /*32-bit*/ ? 64 : 256)
index bcccf750e64fe8b936fb5689b4dc42b5ad912bcb..340a9a24e8b40e340f02fef39b6052cc637567f4 100644 (file)
@@ -8,16 +8,16 @@
  * You may select, at your option, one of the above-listed licenses.
  */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #ifndef ZSTD_ZDICT_H
 #define ZSTD_ZDICT_H
 
+
 /*======  Dependencies  ======*/
 #include <stddef.h>  /* size_t */
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
 
 /* =====   ZDICTLIB_API : control library symbols visibility   ===== */
 #ifndef ZDICTLIB_VISIBLE
index a78b6db45c63a29f290e3027011440a95244168b..7571f8069916c474aeec79865b6828cedf93a6ae 100644 (file)
@@ -7,16 +7,22 @@
  * in the COPYING file in the root directory of this source tree).
  * You may select, at your option, one of the above-listed licenses.
  */
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #ifndef ZSTD_H_235446
 #define ZSTD_H_235446
 
+
 /* ======   Dependencies   ======*/
 #include <stddef.h>   /* size_t */
 
+#include "zstd_errors.h" /* list of errors */
+#if defined(ZSTD_STATIC_LINKING_ONLY) && !defined(ZSTD_H_ZSTD_STATIC_LINKING_ONLY)
+#include <limits.h>   /* INT_MAX */
+#endif /* ZSTD_STATIC_LINKING_ONLY */
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
 
 /* =====   ZSTDLIB_API : control library symbols visibility   ===== */
 #ifndef ZSTDLIB_VISIBLE
@@ -240,7 +246,6 @@ ZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize); /*!< maximum compressed s
 
 
 /*======  Error helper functions  ======*/
-#include "zstd_errors.h" /* list of errors */
 /* ZSTD_isError() :
  * Most ZSTD_* functions returning a size_t value can be tested for error,
  * using ZSTD_isError().
@@ -1215,8 +1220,6 @@ ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
 #if defined(ZSTD_STATIC_LINKING_ONLY) && !defined(ZSTD_H_ZSTD_STATIC_LINKING_ONLY)
 #define ZSTD_H_ZSTD_STATIC_LINKING_ONLY
 
-#include <limits.h>   /* INT_MAX */
-
 /* This can be overridden externally to hide static symbols. */
 #ifndef ZSTDLIB_STATIC_API
 #  if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
index 1bd93d13519873b153a773a5b10ab109b1f63728..3ba3a4f5504b6f9cf1ede6afa1822ad77224535f 100644 (file)
  * or detecting and returning an error
  */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #ifndef BENCH_FN_H_23876
 #define BENCH_FN_H_23876
 
@@ -26,6 +22,10 @@ extern "C" {
 #include <stddef.h>   /* size_t */
 
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 /* ====  Benchmark any function, iterated on a set of blocks  ==== */
 
 /* BMK_runTime_t: valid result return type */
index 6388d4d58c33edc879a349a3d524e356f69f1c6a..7ea018b12f18d473cd1e43baef9354ed4c8cc56a 100644 (file)
   * and display progress result and final summary
   */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #ifndef BENCH_ZSTD_H_3242387
 #define BENCH_ZSTD_H_3242387
 
@@ -27,6 +23,10 @@ extern "C" {
 #include "../lib/zstd.h"     /* ZSTD_compressionParameters */
 
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 /* ===  Constants  === */
 
 #define MB_UNIT 1000000
index feb25a3f9e92c5de5d971f3cdda0909b9b1a896c..1c30a73da89d570fb85cec567aec49e19102f9fd 100644 (file)
 #ifndef ZSTD_FILEIO_ASYNCIO_H
 #define ZSTD_FILEIO_ASYNCIO_H
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #include "../lib/common/mem.h"     /* U32, U64 */
 #include "fileio_types.h"
 #include "platform.h"
@@ -35,6 +31,10 @@ extern "C" {
 
 #define MAX_IO_JOBS          (10)
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 typedef struct {
     /* These struct fields should be set only on creation and not changed afterwards */
     POOL_ctx* threadPool;
index 7a014ee4bb14632255d2e6285c6492d9e715c21c..87f99cda90ddbfe56fb39998efac36d62edf3da8 100644 (file)
 #ifndef ZSTD_FILEIO_COMMON_H
 #define ZSTD_FILEIO_COMMON_H
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #include "../lib/common/mem.h"     /* U32, U64 */
 #include "fileio_types.h"
 #include "platform.h"
 #include "timefn.h"     /* UTIL_getTime, UTIL_clockSpanMicro */
 
+#if !(defined(_MSC_VER) && _MSC_VER >= 1400) \
+    && !(!defined(__64BIT__) && (PLATFORM_POSIX_VERSION >= 200112L)) \
+    && !(defined(__MINGW32__) && !defined(__STRICT_ANSI__) && !defined(__NO_MINGW_LFS) && defined(__MSVCRT__)) \
+    && (defined(_WIN32) && !defined(__DJGPP__))
+#   include <windows.h>
+#endif
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 /*-*************************************
 *  Macros
 ***************************************/
@@ -89,7 +96,6 @@ extern UTIL_time_t g_displayClock;
 #   define LONG_SEEK fseeko64
 #   define LONG_TELL ftello64
 #elif defined(_WIN32) && !defined(__DJGPP__)
-#   include <windows.h>
     static int LONG_SEEK(FILE* file, __int64 offset, int origin) {
         LARGE_INTEGER off;
         DWORD method;
index 4d2b9490e6df502d4d809f443159cec62b642dd2..05a26a564f44d6b3715df80927810017899ae4d3 100644 (file)
 #ifndef PLATFORM_H_MODULE
 #define PLATFORM_H_MODULE
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-
 /* **************************************
 *  Compiler Options
 ****************************************/
@@ -144,10 +138,20 @@ extern "C" {
 #  include <io.h>      /* _isatty */
 #  include <windows.h> /* DeviceIoControl, HANDLE, FSCTL_SET_SPARSE */
 #  include <stdio.h>   /* FILE */
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 static __inline int IS_CONSOLE(FILE* stdStream) {
     DWORD dummy;
     return _isatty(_fileno(stdStream)) && GetConsoleMode((HANDLE)_get_osfhandle(_fileno(stdStream)), &dummy);
 }
+
+#if defined (__cplusplus)
+}
+#endif
+
 #else
 #  define IS_CONSOLE(stdStream) 0
 #endif
@@ -210,9 +214,4 @@ static __inline int IS_CONSOLE(FILE* stdStream) {
 #  endif
 #endif
 
-
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* PLATFORM_H_MODULE */
index b814ff8d8dada4f8dfb753d2b06e2224c2c9e09c..dc7463be35272062c42ce53325b9d3cf9450239f 100644 (file)
 #ifndef TIME_FN_H_MODULE_287987
 #define TIME_FN_H_MODULE_287987
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-
 /*-****************************************
 *  Types
 ******************************************/
@@ -32,6 +26,11 @@ extern "C" {
   typedef unsigned long long PTime;  /* does not support compilers without long long support */
 #endif
 
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 /* UTIL_time_t contains a nanosecond time counter.
  * The absolute value is not meaningful.
  * It's only valid to compute the difference between 2 measurements. */
index 7f65f93731f3795afbb8d446620e7c26acaa5afc..065a35855f2745ff4622a1c092aab17f6e799a6e 100644 (file)
@@ -8,11 +8,6 @@
  * You may select, at your option, one of the above-listed licenses.
  */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
 /*-****************************************
 *  Dependencies
 ******************************************/
@@ -1646,7 +1641,3 @@ int UTIL_countLogicalCores(void)
 {
     return UTIL_countCores(1);
 }
-
-#if defined (__cplusplus)
-}
-#endif
index ec813968446a9bd94f5b5c6721ca955e3cf1de58..5868f5eae3e308c6c4cbbe17bfe572363f12aed9 100644 (file)
@@ -20,6 +20,9 @@
 #include <sys/types.h>    /* stat, utime */
 #include <sys/stat.h>     /* stat, chmod */
 #include "../lib/common/mem.h"          /* U64 */
+#if not (defined(_MSC_VER) || defined(__MINGW32__) || defined (__MSVCRT__))
+#include <libgen.h>
+#endif
 
 /*-************************************************************
 *  Fix fseek()'s 2GiB barrier with MSVC, macOS, *BSD, MinGW
@@ -116,7 +119,6 @@ int UTIL_requireUserConfirmation(const char* prompt, const char* abortMsg, const
 #define STRDUP(s) _strdup(s)
 #else
 #define PATH_SEP '/'
-#include <libgen.h>
 #define STRDUP(s) strdup(s)
 #endif
 
index 230bf8411b0a0de036c29ecfe3816bf00a502346..dae6787d3adda1337c3ad0331c650bb748001816 100644 (file)
 #ifndef ZSTD_ZLIBWRAPPER_H
 #define ZSTD_ZLIBWRAPPER_H
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
 #define ZLIB_CONST
 #define Z_PREFIX
 #define ZLIB_INTERNAL   /* disables gz*64 functions but fixes zlib 1.2.4 with Z_PREFIX */
@@ -29,6 +24,11 @@ extern "C" {
     #define _Z_OF OF
 #endif
 
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
 /* returns a string with version of zstd library */
 const char * zstdVersion(void);