diff options
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/bzip.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/examples/bzip.cpp b/doc/examples/bzip.cpp index 82bc3100a..a16d4f8fe 100644 --- a/doc/examples/bzip.cpp +++ b/doc/examples/bzip.cpp @@ -14,8 +14,6 @@ This file is in the public domain #if defined(BOTAN_EXT_COMPRESSOR_BZIP2) #include <botan/bzip2.h> -#else - #error "You didn't compile the bzip module into Botan" #endif const std::string SUFFIX = ".bz2"; @@ -52,11 +50,19 @@ int main(int argc, char* argv[]) try { - Botan::Filter* bzip; + Botan::Filter* bzip = 0; +#ifdef BOTAN_EXT_COMPRESSOR_BZIP2 if(decompress) bzip = new Botan::Bzip_Decompression(small); else bzip = new Botan::Bzip_Compression(level); +#endif + + if(!bzip) + { + std::cout << "Sorry, support for bzip2 not compiled into Botan\n"; + return 1; + } Botan::Pipe pipe(bzip); |