From 1f799c26d7a76b84bd6d23fea97db6f182354459 Mon Sep 17 00:00:00 2001
From: Hal Finkel <hfinkel@anl.gov>
Date: Fri, 28 Sep 2018 16:51:09 -0500
Subject: [PATCH] make new version of SZ compile with older zstd

---
 thirdparty/SZ/sz/src/utility.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/thirdparty/SZ/sz/src/utility.c b/thirdparty/SZ/sz/src/utility.c
index be7b02e..680914e 100644
--- a/thirdparty/SZ/sz/src/utility.c
+++ b/thirdparty/SZ/sz/src/utility.c
@@ -155,9 +155,15 @@ float calculate_delta_t(size_t size){
 
 int is_lossless_compressed_data(unsigned char* compressedBytes, size_t cmpSize)
 {
+#if ZSTD_VERSION_NUMBER >= 10300
 	int frameContentSize = ZSTD_getFrameContentSize(compressedBytes, cmpSize);
 	if(frameContentSize != ZSTD_CONTENTSIZE_ERROR)
 		return ZSTD_COMPRESSOR;
+#else
+	int frameContentSize = ZSTD_getDecompressedSize(compressedBytes, cmpSize);
+	if(frameContentSize == 0)
+		return ZSTD_COMPRESSOR;
+#endif
 	
 	int flag = isZlibFormat(compressedBytes[0], compressedBytes[1]);
 	if(flag)
-- 
GitLab