From b42dd27ef5ad325943174b43334c3c63d1e94a35 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Fri, 27 Jan 2017 16:00:19 -0800 Subject: [PATCH] Add include guards and extern C --- lib/common/pool.h | 10 ++++++++++ lib/compress/zstdmt_compress.c | 2 +- lib/compress/zstdmt_compress.h | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/common/pool.h b/lib/common/pool.h index c26f543f..50cb25b1 100644 --- a/lib/common/pool.h +++ b/lib/common/pool.h @@ -9,6 +9,11 @@ #ifndef POOL_H #define POOL_H +#if defined (__cplusplus) +extern "C" { +#endif + + #include /* size_t */ typedef struct POOL_ctx_s POOL_ctx; @@ -43,4 +48,9 @@ typedef void (*POOL_add_function)(void *, POOL_function, void *); */ void POOL_add(void *ctx, POOL_function function, void *opaque); + +#if defined (__cplusplus) +} +#endif + #endif diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index 5f0bf2ab..7423d9db 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -21,7 +21,7 @@ /* ====== Dependencies ====== */ #include /* malloc */ #include /* memcpy */ -#include /* threadpool */ +#include "pool.h" /* threadpool */ #include "threading.h" /* mutex */ #include "zstd_internal.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */ #include "zstdmt_compress.h" diff --git a/lib/compress/zstdmt_compress.h b/lib/compress/zstdmt_compress.h index 92de52d6..3a26b93d 100644 --- a/lib/compress/zstdmt_compress.h +++ b/lib/compress/zstdmt_compress.h @@ -7,6 +7,13 @@ * of patent rights can be found in the PATENTS file in the same directory. */ + #ifndef ZSTDMT_COMPRESS_H + #define ZSTDMT_COMPRESS_H + + #if defined (__cplusplus) + extern "C" { + #endif + /* Note : All prototypes defined in this file shall be considered experimental. * There is no guarantee of API continuity (yet) on any of these prototypes */ @@ -62,3 +69,10 @@ typedef enum { * Parameters not explicitly reset by ZSTDMT_init*() remain the same in consecutive compression sessions. * @return : 0, or an error code (which can be tested using ZSTD_isError()) */ ZSTDLIB_API size_t ZSTDMT_setMTCtxParameter(ZSTDMT_CCtx* mtctx, ZSDTMT_parameter parameter, unsigned value); + + +#if defined (__cplusplus) +} +#endif + +#endif /* ZSTDMT_COMPRESS_H */