]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Guard these files to make sure one gets compiler errors and not just linker errors.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Dec 2013 14:15:56 +0000 (14:15 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Dec 2013 14:15:56 +0000 (14:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@32111 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/bundled/boost-1.49.0/include/boost/iostreams/filter/bzip2.hpp
deal.II/bundled/boost-1.49.0/include/boost/iostreams/filter/zlib.hpp

index bc4b18f04aa273fb0865a2b589aae25ffd5776cf..0ce4984a1a3035b7926cb64b92d27b4ecba29d13 100644 (file)
@@ -1,3 +1,8 @@
+#include <deal.II/base/config.h>
+#ifndef DEAL_II_WITH_BZIP2
+#  error "You cannot use this header file since your system does not have a complete installation of libbz2"
+#endif
+
 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
 // (C) Copyright 2003-2007 Jonathan Turkanis
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -14,8 +19,8 @@
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
 #endif
-                   
-#include <cassert>                            
+
+#include <cassert>
 #include <memory>            // allocator.
 #include <new>               // bad_alloc.
 #include <boost/config.hpp>  // MSVC, STATIC_CONSTANT, DEDUCED_TYPENAME, DINKUM.
 #include <boost/iostreams/detail/config/dyn_link.hpp>
 #include <boost/iostreams/detail/config/wide_streams.hpp>
 #include <boost/iostreams/detail/ios.hpp>  // failure, streamsize.
-#include <boost/iostreams/filter/symmetric.hpp>               
-#include <boost/iostreams/pipeline.hpp>       
-#include <boost/type_traits/is_same.hpp>     
+#include <boost/iostreams/filter/symmetric.hpp>
+#include <boost/iostreams/pipeline.hpp>
+#include <boost/type_traits/is_same.hpp>
 
 // Must come last.
 #ifdef BOOST_MSVC
 # pragma warning(push)
 # pragma warning(disable:4251 4231 4660)
 #endif
-#include <boost/config/abi_prefix.hpp>           
+#include <boost/config/abi_prefix.hpp>
 
 // Temporary fix.
 #undef small
@@ -55,7 +60,7 @@ BOOST_IOSTREAMS_DECL extern const int ok;
 BOOST_IOSTREAMS_DECL extern const int run_ok;
 BOOST_IOSTREAMS_DECL extern const int flush_ok;
 BOOST_IOSTREAMS_DECL extern const int finish_ok;
-BOOST_IOSTREAMS_DECL extern const int stream_end;    
+BOOST_IOSTREAMS_DECL extern const int stream_end;
 BOOST_IOSTREAMS_DECL extern const int sequence_error;
 BOOST_IOSTREAMS_DECL extern const int param_error;
 BOOST_IOSTREAMS_DECL extern const int mem_error;
@@ -77,7 +82,7 @@ const int default_block_size   = 9;
 const int default_work_factor  = 30;
 const bool default_small       = false;
 
-} // End namespace bzip2. 
+} // End namespace bzip2.
 
 //
 // Class name: bzip2_params.
@@ -136,14 +141,14 @@ struct bzip2_allocator : private Base {
 private:
     typedef typename Base::size_type size_type;
 public:
-    BOOST_STATIC_CONSTANT(bool, custom = 
+    BOOST_STATIC_CONSTANT(bool, custom =
         (!is_same<std::allocator<char>, Base>::value));
     typedef typename bzip2_allocator_traits<Alloc>::type allocator_type;
     static void* allocate(void* self, int items, int size);
     static void deallocate(void* self, void* address);
 };
 
-class BOOST_IOSTREAMS_DECL bzip2_base  { 
+class BOOST_IOSTREAMS_DECL bzip2_base  {
 public:
     typedef char char_type;
 protected:
@@ -151,7 +156,7 @@ protected:
     ~bzip2_base();
     bzip2_params& params() { return params_; }
     bool& ready() { return ready_; }
-    template<typename Alloc> 
+    template<typename Alloc>
     void init( bool compress,
                bzip2_allocator<Alloc>& alloc )
         {
@@ -171,10 +176,10 @@ protected:
     int decompress();
     void end(bool compress);
 private:
-    void do_init( bool compress, 
+    void do_init( bool compress,
                   #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-                      bzip2::alloc_func, 
-                      bzip2::free_func, 
+                      bzip2::alloc_func,
+                      bzip2::free_func,
                   #endif
                   void* derived );
     bzip2_params  params_;
@@ -188,14 +193,14 @@ private:
 //      delegating to the libbzip2 function BZ_bzCompress.
 //
 template<typename Alloc = std::allocator<char> >
-class bzip2_compressor_impl 
-    : public bzip2_base, 
+class bzip2_compressor_impl
+    : public bzip2_base,
       #if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
           public
       #endif
-      bzip2_allocator<Alloc> 
+      bzip2_allocator<Alloc>
 {
-public: 
+public:
     bzip2_compressor_impl(const bzip2_params&);
     bool filter( const char*& src_begin, const char* src_end,
                  char*& dest_begin, char* dest_end, bool flush );
@@ -211,13 +216,13 @@ private:
 //      delegating to the libbzip2 function BZ_bzDecompress.
 //
 template<typename Alloc = std::allocator<char> >
-class bzip2_decompressor_impl 
-    : public bzip2_base, 
+class bzip2_decompressor_impl
+    : public bzip2_base,
       #if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
           public
       #endif
-      bzip2_allocator<Alloc> 
-{ 
+      bzip2_allocator<Alloc>
+{
 public:
     bzip2_decompressor_impl(bool small = bzip2::default_small);
     bool filter( const char*& begin_in, const char* end_in,
@@ -236,8 +241,8 @@ private:
 //      compression using libbzip2.
 //
 template<typename Alloc = std::allocator<char> >
-struct basic_bzip2_compressor 
-    : symmetric_filter<detail::bzip2_compressor_impl<Alloc>, Alloc> 
+struct basic_bzip2_compressor
+    : symmetric_filter<detail::bzip2_compressor_impl<Alloc>, Alloc>
 {
 private:
     typedef detail::bzip2_compressor_impl<Alloc>        impl_type;
@@ -245,7 +250,7 @@ private:
 public:
     typedef typename base_type::char_type               char_type;
     typedef typename base_type::category                category;
-    basic_bzip2_compressor( const bzip2_params& = bzip2::default_block_size, 
+    basic_bzip2_compressor( const bzip2_params& = bzip2::default_block_size,
                             int buffer_size =  default_device_buffer_size );
 };
 BOOST_IOSTREAMS_PIPABLE(basic_bzip2_compressor, 1)
@@ -258,8 +263,8 @@ typedef basic_bzip2_compressor<> bzip2_compressor;
 //      decompression using libbzip2.
 //
 template<typename Alloc = std::allocator<char> >
-struct basic_bzip2_decompressor 
-    : symmetric_filter<detail::bzip2_decompressor_impl<Alloc>, Alloc> 
+struct basic_bzip2_decompressor
+    : symmetric_filter<detail::bzip2_decompressor_impl<Alloc>, Alloc>
 {
 private:
     typedef detail::bzip2_decompressor_impl<Alloc>      impl_type;
@@ -282,9 +287,9 @@ namespace detail {
 
 template<typename Alloc, typename Base>
 void* bzip2_allocator<Alloc, Base>::allocate(void* self, int items, int size)
-{ 
+{
     size_type len = items * size;
-    char* ptr = 
+    char* ptr =
         static_cast<allocator_type*>(self)->allocate
             (len + sizeof(size_type)
             #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
@@ -297,10 +302,10 @@ void* bzip2_allocator<Alloc, Base>::allocate(void* self, int items, int size)
 
 template<typename Alloc, typename Base>
 void bzip2_allocator<Alloc, Base>::deallocate(void* self, void* address)
-{ 
+{
     char* ptr = reinterpret_cast<char*>(address) - sizeof(size_type);
     size_type len = *reinterpret_cast<size_type*>(ptr) + sizeof(size_type);
-    static_cast<allocator_type*>(self)->deallocate(ptr, len); 
+    static_cast<allocator_type*>(self)->deallocate(ptr, len);
 }
 
 //------------------Implementation of bzip2_compressor_impl-------------------//
@@ -324,19 +329,19 @@ bool bzip2_compressor_impl<Alloc>::filter
 }
 
 template<typename Alloc>
-void bzip2_compressor_impl<Alloc>::close() 
-{ 
+void bzip2_compressor_impl<Alloc>::close()
+{
     try {
         end(true);
-    } catch (...) { 
-        eof_ = false; 
+    } catch (...) {
+        eof_ = false;
         throw;
     }
     eof_ = false;
 }
 
 template<typename Alloc>
-inline void bzip2_compressor_impl<Alloc>::init() 
+inline void bzip2_compressor_impl<Alloc>::init()
 { bzip2_base::init(true, static_cast<bzip2_allocator<Alloc>&>(*this)); }
 
 //------------------Implementation of bzip2_decompressor_impl-----------------//
@@ -357,7 +362,7 @@ bool bzip2_decompressor_impl<Alloc>::filter
         else
             close();
     }
-    if (!ready()) 
+    if (!ready())
         init();
     before(src_begin, src_end, dest_begin, dest_end);
     int result = decompress();
@@ -366,16 +371,16 @@ bool bzip2_decompressor_impl<Alloc>::filter
     after(src_begin, dest_begin);
     bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result);
     eof_ = result == bzip2::stream_end;
-    return true; 
+    return true;
 }
 
 template<typename Alloc>
-void bzip2_decompressor_impl<Alloc>::close() 
-{ 
+void bzip2_decompressor_impl<Alloc>::close()
+{
     try {
         end(false);
-    } catch (...) { 
-        eof_ = false; 
+    } catch (...) {
+        eof_ = false;
         throw;
     }
     eof_ = false;
@@ -390,15 +395,15 @@ inline void bzip2_decompressor_impl<Alloc>::init()
 
 template<typename Alloc>
 basic_bzip2_compressor<Alloc>::basic_bzip2_compressor
-        (const bzip2_params& p, int buffer_size) 
-    : base_type(buffer_size, p) 
+        (const bzip2_params& p, int buffer_size)
+    : base_type(buffer_size, p)
     { }
 
 //------------------Implementation of bzip2_decompressor----------------------//
 
 template<typename Alloc>
 basic_bzip2_decompressor<Alloc>::basic_bzip2_decompressor
-        (bool small, int buffer_size) 
+        (bool small, int buffer_size)
     : base_type(buffer_size, small)
     { }
 
index b0327f3cb8fdf363923f91ac919051a37d1f4921..925af57cdd75ae9fcff92f302877010ff8265c80 100644 (file)
@@ -1,3 +1,9 @@
+#include <deal.II/base/config.h>
+#ifndef DEAL_II_WITH_ZLIB
+#  error "You cannot use this header file since your system does not have a complete installation of zlib"
+#endif
+
+
 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
 // (C) Copyright 2003-2007 Jonathan Turkanis
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
-#endif              
+#endif
 
-#include <cassert>                            
-#include <iosfwd>            // streamsize.                 
+#include <cassert>
+#include <iosfwd>            // streamsize.
 #include <memory>            // allocator, bad_alloc.
-#include <new>          
+#include <new>
 #include <boost/config.hpp>  // MSVC, STATIC_CONSTANT, DEDUCED_TYPENAME, DINKUM.
 #include <boost/cstdint.hpp> // uint*_t
 #include <boost/detail/workaround.hpp>
@@ -28,8 +34,8 @@
 #include <boost/iostreams/detail/config/wide_streams.hpp>
 #include <boost/iostreams/detail/config/zlib.hpp>
 #include <boost/iostreams/detail/ios.hpp>  // failure, streamsize.
-#include <boost/iostreams/filter/symmetric.hpp>                
-#include <boost/iostreams/pipeline.hpp>                
+#include <boost/iostreams/filter/symmetric.hpp>
+#include <boost/iostreams/pipeline.hpp>
 #include <boost/type_traits/is_same.hpp>
 
 // Must come last.
@@ -37,7 +43,7 @@
 # pragma warning(push)
 # pragma warning(disable:4251 4231 4660)         // Dependencies not exported.
 #endif
-#include <boost/config/abi_prefix.hpp>           
+#include <boost/config/abi_prefix.hpp>
 
 namespace boost { namespace iostreams {
 
@@ -100,7 +106,7 @@ const int default_mem_level                  = 8;
 const bool default_crc                       = false;
 const bool default_noheader                  = false;
 
-} // End namespace zlib. 
+} // End namespace zlib.
 
 //
 // Class name: zlib_params.
@@ -112,13 +118,13 @@ struct zlib_params {
     // Non-explicit constructor.
     zlib_params( int level           = zlib::default_compression,
                  int method          = zlib::deflated,
-                 int window_bits     = zlib::default_window_bits, 
-                 int mem_level       = zlib::default_mem_level, 
+                 int window_bits     = zlib::default_window_bits,
+                 int mem_level       = zlib::default_mem_level,
                  int strategy        = zlib::default_strategy,
                  bool noheader       = zlib::default_noheader,
                  bool calculate_crc  = zlib::default_crc )
         : level(level), method(method), window_bits(window_bits),
-          mem_level(mem_level), strategy(strategy),  
+          mem_level(mem_level), strategy(strategy),
           noheader(noheader), calculate_crc(calculate_crc)
         { }
     int level;
@@ -162,22 +168,22 @@ struct zlib_allocator : private Base {
 private:
     typedef typename Base::size_type size_type;
 public:
-    BOOST_STATIC_CONSTANT(bool, custom = 
+    BOOST_STATIC_CONSTANT(bool, custom =
         (!is_same<std::allocator<char>, Base>::value));
     typedef typename zlib_allocator_traits<Alloc>::type allocator_type;
     static void* allocate(void* self, zlib::uint items, zlib::uint size);
     static void deallocate(void* self, void* address);
 };
 
-class BOOST_IOSTREAMS_DECL zlib_base { 
+class BOOST_IOSTREAMS_DECL zlib_base {
 public:
     typedef char char_type;
 protected:
     zlib_base();
     ~zlib_base();
     void* stream() { return stream_; }
-    template<typename Alloc> 
-    void init( const zlib_params& p, 
+    template<typename Alloc>
+    void init( const zlib_params& p,
                bool compress,
                zlib_allocator<Alloc>& zalloc )
         {
@@ -191,9 +197,9 @@ protected:
         }
     void before( const char*& src_begin, const char* src_end,
                  char*& dest_begin, char* dest_end );
-    void after( const char*& src_begin, char*& dest_begin, 
+    void after( const char*& src_begin, char*& dest_begin,
                 bool compress );
-    int xdeflate(int flush);  // Prefix 'x' prevents symbols from being 
+    int xdeflate(int flush);  // Prefix 'x' prevents symbols from being
     int xinflate(int flush);  // redefined when Z_PREFIX is defined
     void reset(bool compress, bool realloc);
 public:
@@ -201,10 +207,10 @@ public:
     int total_in() const { return total_in_; }
     int total_out() const { return total_out_; }
 private:
-    void do_init( const zlib_params& p, bool compress, 
+    void do_init( const zlib_params& p, bool compress,
                   #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-                      zlib::xalloc_func, 
-                      zlib::xfree_func, 
+                      zlib::xalloc_func,
+                      zlib::xfree_func,
                   #endif
                   void* derived );
     void*        stream_;         // Actual type: z_stream*.
@@ -221,8 +227,8 @@ private:
 //      delegating to the zlib function deflate.
 //
 template<typename Alloc = std::allocator<char> >
-class zlib_compressor_impl : public zlib_base, public zlib_allocator<Alloc> { 
-public: 
+class zlib_compressor_impl : public zlib_base, public zlib_allocator<Alloc> {
+public:
     zlib_compressor_impl(const zlib_params& = zlib::default_compression);
     ~zlib_compressor_impl();
     bool filter( const char*& src_begin, const char* src_end,
@@ -257,8 +263,8 @@ private:
 //      compression using zlib.
 //
 template<typename Alloc = std::allocator<char> >
-struct basic_zlib_compressor 
-    : symmetric_filter<detail::zlib_compressor_impl<Alloc>, Alloc> 
+struct basic_zlib_compressor
+    : symmetric_filter<detail::zlib_compressor_impl<Alloc>, Alloc>
 {
 private:
     typedef detail::zlib_compressor_impl<Alloc>         impl_type;
@@ -266,7 +272,7 @@ private:
 public:
     typedef typename base_type::char_type               char_type;
     typedef typename base_type::category                category;
-    basic_zlib_compressor( const zlib_params& = zlib::default_compression, 
+    basic_zlib_compressor( const zlib_params& = zlib::default_compression,
                            int buffer_size = default_device_buffer_size );
     zlib::ulong crc() { return this->filter().crc(); }
     int total_in() {  return this->filter().total_in(); }
@@ -281,8 +287,8 @@ typedef basic_zlib_compressor<> zlib_compressor;
 //      decompression using zlib.
 //
 template<typename Alloc = std::allocator<char> >
-struct basic_zlib_decompressor 
-    : symmetric_filter<detail::zlib_decompressor_impl<Alloc>, Alloc> 
+struct basic_zlib_decompressor
+    : symmetric_filter<detail::zlib_decompressor_impl<Alloc>, Alloc>
 {
 private:
     typedef detail::zlib_decompressor_impl<Alloc>       impl_type;
@@ -311,9 +317,9 @@ namespace detail {
 template<typename Alloc, typename Base>
 void* zlib_allocator<Alloc, Base>::allocate
     (void* self, zlib::uint items, zlib::uint size)
-{ 
+{
     size_type len = items * size;
-    char* ptr = 
+    char* ptr =
         static_cast<allocator_type*>(self)->allocate
             (len + sizeof(size_type)
             #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
@@ -326,10 +332,10 @@ void* zlib_allocator<Alloc, Base>::allocate
 
 template<typename Alloc, typename Base>
 void zlib_allocator<Alloc, Base>::deallocate(void* self, void* address)
-{ 
+{
     char* ptr = reinterpret_cast<char*>(address) - sizeof(size_type);
     size_type len = *reinterpret_cast<size_type*>(ptr) + sizeof(size_type);
-    static_cast<allocator_type*>(self)->deallocate(ptr, len); 
+    static_cast<allocator_type*>(self)->deallocate(ptr, len);
 }
 
 //------------------Implementation of zlib_compressor_impl--------------------//
@@ -351,7 +357,7 @@ bool zlib_compressor_impl<Alloc>::filter
     int result = xdeflate(flush ? zlib::finish : zlib::no_flush);
     after(src_begin, dest_begin, true);
     zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result);
-    return result != zlib::stream_end; 
+    return result != zlib::stream_end;
 }
 
 template<typename Alloc>
@@ -370,10 +376,10 @@ zlib_decompressor_impl<Alloc>::~zlib_decompressor_impl()
 
 template<typename Alloc>
 zlib_decompressor_impl<Alloc>::zlib_decompressor_impl(int window_bits)
-{ 
+{
     zlib_params p;
     p.window_bits = window_bits;
-    init(p, false, static_cast<zlib_allocator<Alloc>&>(*this)); 
+    init(p, false, static_cast<zlib_allocator<Alloc>&>(*this));
 }
 
 template<typename Alloc>
@@ -400,19 +406,19 @@ void zlib_decompressor_impl<Alloc>::close() {
 
 template<typename Alloc>
 basic_zlib_compressor<Alloc>::basic_zlib_compressor
-    (const zlib_params& p, int buffer_size) 
+    (const zlib_params& p, int buffer_size)
     : base_type(buffer_size, p) { }
 
 //------------------Implementation of zlib_decompressor-----------------------//
 
 template<typename Alloc>
 basic_zlib_decompressor<Alloc>::basic_zlib_decompressor
-    (int window_bits, int buffer_size) 
+    (int window_bits, int buffer_size)
     : base_type(buffer_size, window_bits) { }
 
 template<typename Alloc>
 basic_zlib_decompressor<Alloc>::basic_zlib_decompressor
-    (const zlib_params& p, int buffer_size) 
+    (const zlib_params& p, int buffer_size)
     : base_type(buffer_size, p) { }
 
 //----------------------------------------------------------------------------//

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.