# HG changeset patch # User Sebastien Jodogne # Date 1778747477 -7200 # Node ID 0ab9e0f34268b014036fcbfa220f9e62b091800f # Parent e10d890319c566ec496061bd357e55de61f1e342 fix build if zlib is disabled diff -r e10d890319c5 -r 0ab9e0f34268 OrthancFramework/Sources/DataSource/StorageAreaDataSource.cpp --- a/OrthancFramework/Sources/DataSource/StorageAreaDataSource.cpp Thu May 14 10:27:26 2026 +0200 +++ b/OrthancFramework/Sources/DataSource/StorageAreaDataSource.cpp Thu May 14 10:31:17 2026 +0200 @@ -25,12 +25,15 @@ #include "../PrecompiledHeaders.h" #include "StorageAreaDataSource.h" -#include "../Compression/ZlibCompressor.h" #include "../OrthancException.h" #include "../StringMemoryBuffer.h" #include "../Toolbox.h" #include "DataSourceReader.h" +#if ORTHANC_ENABLE_ZLIB == 1 +# include "../Compression/ZlibCompressor.h" +#endif + #include #include @@ -203,6 +206,7 @@ case CompressionType_ZlibWithSize: { +#if ORTHANC_ENABLE_ZLIB == 1 ZlibCompressor zlib; std::string content; @@ -221,6 +225,9 @@ boost::shared_ptr value(new Value(StringMemoryBuffer::CreateFromSwap(content))); return new Range(value); +#else + throw OrthancException(ErrorCode_InternalError, "Support for zlib is disabled, cannot uncompress attachment"); +#endif } default: diff -r e10d890319c5 -r 0ab9e0f34268 OrthancFramework/Sources/DataSource/StorageAreaDataSource.h --- a/OrthancFramework/Sources/DataSource/StorageAreaDataSource.h Thu May 14 10:27:26 2026 +0200 +++ b/OrthancFramework/Sources/DataSource/StorageAreaDataSource.h Thu May 14 10:31:17 2026 +0200 @@ -24,6 +24,10 @@ #pragma once +#if !defined(ORTHANC_ENABLE_ZLIB) +# error The macro ORTHANC_ENABLE_ZLIB must be defined +#endif + #include "../Compatibility.h" #include "../FileStorage/FileInfo.h" #include "../FileStorage/IStorageArea.h"