[trace] Minor fixes found during integration
* Mark `ZSTD_CCtx_getParameter()` as const
* Add `extern "C"` guards to `zstd_trace.h`
diff --git a/lib/common/zstd_trace.h b/lib/common/zstd_trace.h
index f2fa7f7..487617c 100644
--- a/lib/common/zstd_trace.h
+++ b/lib/common/zstd_trace.h
@@ -11,6 +11,10 @@
#ifndef ZSTD_TRACE_H
#define ZSTD_TRACE_H
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
#include <stddef.h>
/* weak symbol support */
@@ -141,4 +145,8 @@
#endif /* ZSTD_TRACE */
+#if defined (__cplusplus)
+}
+#endif
+
#endif /* ZSTD_TRACE_H */
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c
index ac11c3d..5b054a7 100644
--- a/lib/compress/zstd_compress.c
+++ b/lib/compress/zstd_compress.c
@@ -797,7 +797,7 @@
}
}
-size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value)
+size_t ZSTD_CCtx_getParameter(ZSTD_CCtx const* cctx, ZSTD_cParameter param, int* value)
{
return ZSTD_CCtxParams_getParameter(&cctx->requestedParams, param, value);
}
diff --git a/lib/zstd.h b/lib/zstd.h
index 230adee..64265f6 100644
--- a/lib/zstd.h
+++ b/lib/zstd.h
@@ -1837,7 +1837,7 @@
* and store it into int* value.
* @return : 0, or an error code (which can be tested with ZSTD_isError()).
*/
-ZSTDLIB_API size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);
+ZSTDLIB_API size_t ZSTD_CCtx_getParameter(const ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);
/*! ZSTD_CCtx_params :