summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakayuki Matsuoka <t-mat@users.noreply.github.com>2022-08-07 10:07:41 (GMT)
committerTakayuki Matsuoka <t-mat@users.noreply.github.com>2022-08-07 10:07:41 (GMT)
commit50915609a9a0c1feb616c4de534f4a388d48f79a (patch)
tree6e31a2676d09331e38fd37678d0b2d7f7bbdd4e7
parent721e76d1af1d248d0e6fefb2a090cd4b1c4a08f2 (diff)
downloadlz4-50915609a9a0c1feb616c4de534f4a388d48f79a.zip
lz4-50915609a9a0c1feb616c4de534f4a388d48f79a.tar.gz
lz4-50915609a9a0c1feb616c4de534f4a388d48f79a.tar.bz2
Fix: Disable LZ4HC correspond functions when LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION is enabled
-rw-r--r--lib/lz4hc.c2
-rw-r--r--lib/lz4hc.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index 4771ef8..b21ad6b 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -1225,6 +1225,7 @@ int LZ4_resetStreamStateHC(void* state, char* inputBuffer)
return 0;
}
+#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION)
void* LZ4_createHC (const char* inputBuffer)
{
LZ4_streamHC_t* const hc4 = LZ4_createStreamHC();
@@ -1239,6 +1240,7 @@ int LZ4_freeHC (void* LZ4HC_Data)
FREEMEM(LZ4HC_Data);
return 0;
}
+#endif
int LZ4_compressHC2_continue (void* LZ4HC_Data, const char* src, char* dst, int srcSize, int cLevel)
{
diff --git a/lib/lz4hc.h b/lib/lz4hc.h
index d2e5193..e937acf 100644
--- a/lib/lz4hc.h
+++ b/lib/lz4hc.h
@@ -270,9 +270,11 @@ LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_comp
* LZ4_slideInputBufferHC() will truncate the history of the stream, rather
* than preserve a window-sized chunk of history.
*/
+#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION)
LZ4_DEPRECATED("use LZ4_createStreamHC() instead") LZ4LIB_API void* LZ4_createHC (const char* inputBuffer);
-LZ4_DEPRECATED("use LZ4_saveDictHC() instead") LZ4LIB_API char* LZ4_slideInputBufferHC (void* LZ4HC_Data);
LZ4_DEPRECATED("use LZ4_freeStreamHC() instead") LZ4LIB_API int LZ4_freeHC (void* LZ4HC_Data);
+#endif
+LZ4_DEPRECATED("use LZ4_saveDictHC() instead") LZ4LIB_API char* LZ4_slideInputBufferHC (void* LZ4HC_Data);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel);
LZ4_DEPRECATED("use LZ4_createStreamHC() instead") LZ4LIB_API int LZ4_sizeofStreamStateHC(void);