From de6c6bce859193ac7dc50a96b01c6de4ae9e328b Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Thu, 24 Aug 2017 18:09:50 -0700 Subject: [PATCH] Fix zstd_internal.h for C++ mode --- lib/common/zstd_common.c | 3 +-- lib/common/zstd_internal.h | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/common/zstd_common.c b/lib/common/zstd_common.c index 08384cabf..1155c60c4 100644 --- a/lib/common/zstd_common.c +++ b/lib/common/zstd_common.c @@ -15,8 +15,7 @@ #include /* malloc, calloc, free */ #include /* memset */ #include "error_private.h" -#define ZSTD_STATIC_LINKING_ONLY -#include "zstd.h" +#include "zstd_internal.h" /*-**************************************** diff --git a/lib/common/zstd_internal.h b/lib/common/zstd_internal.h index ac1f39896..fce75723a 100644 --- a/lib/common/zstd_internal.h +++ b/lib/common/zstd_internal.h @@ -29,6 +29,11 @@ #include "xxhash.h" /* XXH_reset, update, digest */ +#if defined (__cplusplus) +extern "C" { +#endif + + /*-************************************* * Debug ***************************************/ @@ -334,5 +339,8 @@ typedef struct { size_t ZSTD_getcBlockSize(const void* src, size_t srcSize, blockProperties_t* bpPtr); +#if defined (__cplusplus) +} +#endif #endif /* ZSTD_CCOMMON_H_MODULE */