diff options
author | lloyd <[email protected]> | 2008-09-24 11:54:00 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-24 11:54:00 +0000 |
commit | 6620327c8c79c8bcf897500ce12021285017ac5a (patch) | |
tree | ac14a3fb8e8ea576692f607c4415155f1ca28848 /doc/examples | |
parent | caebef52b255130a3d7fa88e312b2d0891b90a45 (diff) |
If the Zlib module is not compiled in, don't #error and abort the whole
compile, just skip adding a Zlib filter into the Pipe.
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/decrypt.cpp | 4 | ||||
-rw-r--r-- | doc/examples/encrypt.cpp | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/doc/examples/decrypt.cpp b/doc/examples/decrypt.cpp index 279a341fe..e0c4a1f48 100644 --- a/doc/examples/decrypt.cpp +++ b/doc/examples/decrypt.cpp @@ -20,8 +20,6 @@ This file is in the public domain #if defined(BOTAN_EXT_COMPRESSOR_ZLIB) #include <botan/zlib.h> -#else - #error "You didn't compile the zlib module into Botan" #endif using namespace Botan; @@ -112,7 +110,9 @@ int main(int argc, char* argv[]) Pipe pipe(new Base64_Decoder, get_cipher(algo + "/CBC", bc_key, iv, DECRYPTION), +#ifdef BOTAN_EXT_COMPRESSOR_ZLIB new Zlib_Decompression, +#endif new Fork( 0, new Chain(new MAC_Filter("HMAC(SHA-1)", mac_key), diff --git a/doc/examples/encrypt.cpp b/doc/examples/encrypt.cpp index e5245cd5d..7c8649004 100644 --- a/doc/examples/encrypt.cpp +++ b/doc/examples/encrypt.cpp @@ -28,8 +28,6 @@ This file is in the public domain #if defined(BOTAN_EXT_COMPRESSOR_ZLIB) #include <botan/zlib.h> -#else - #error "You didn't compile the zlib module into Botan" #endif using namespace Botan; @@ -141,7 +139,10 @@ int main(int argc, char* argv[]) new Chain(new MAC_Filter("HMAC(SHA-1)", mac_key), new Base64_Encoder ), - new Chain(new Zlib_Compression, + new Chain( +#ifdef BOTAN_EXT_COMPRESSOR_ZLIB + new Zlib_Compression, +#endif get_cipher(algo + "/CBC", bc_key, iv, ENCRYPTION), new Base64_Encoder(true) ) |