$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r64086 - in sandbox/gil/boost/gil/extension/io2: . detail
From: dsaritz_at_[hidden]
Date: 2010-07-17 06:40:45
Author: psiha
Date: 2010-07-17 06:40:43 EDT (Sat, 17 Jul 2010)
New Revision: 64086
URL: http://svn.boost.org/trac/boost/changeset/64086
Log:
Moved the extern_lib.hpp and extern_lib_guard.hpp headers to the detail subfolder and renamed the second one to gp_extern_lib_guard.hpp.
Removed traces of the no longer used BOOST_GIL_USE_NATIVE_IO macro.
Minor other changes.
Added:
   sandbox/gil/boost/gil/extension/io2/detail/extern_lib.hpp
      - copied unchanged from r64073, /sandbox/gil/boost/gil/extension/io2/extern_lib.hpp
   sandbox/gil/boost/gil/extension/io2/detail/gp_extern_lib_guard.hpp
      - copied, changed from r64073, /sandbox/gil/boost/gil/extension/io2/extern_lib_guard.hpp
Removed:
   sandbox/gil/boost/gil/extension/io2/extern_lib.hpp
   sandbox/gil/boost/gil/extension/io2/extern_lib_guard.hpp
Text files modified: 
   sandbox/gil/boost/gil/extension/io2/detail/gp_extern_lib_guard.hpp |   267 +++++++++++++++++++-------------------- 
   sandbox/gil/boost/gil/extension/io2/gp_private_base.hpp            |    16 +                                       
   2 files changed, 139 insertions(+), 144 deletions(-)
Copied: sandbox/gil/boost/gil/extension/io2/detail/gp_extern_lib_guard.hpp (from r64073, /sandbox/gil/boost/gil/extension/io2/extern_lib_guard.hpp)
==============================================================================
--- /sandbox/gil/boost/gil/extension/io2/extern_lib_guard.hpp	(original)
+++ sandbox/gil/boost/gil/extension/io2/detail/gp_extern_lib_guard.hpp	2010-07-17 06:40:43 EDT (Sat, 17 Jul 2010)
@@ -40,173 +40,164 @@
 {
 //------------------------------------------------------------------------------
 
-#ifndef BOOST_GIL_USE_NATIVE_IO
+#ifndef BOOST_GIL_EXTERNAL_LIB
+    //#define BOOST_GIL_EXTERNAL_LIB DynamicLinkAutoLoadAutoInitialize
+    #define BOOST_GIL_EXTERNAL_LIB ( BOOST_LIB_LINK_RUNTIME_AUTO_LOAD, BOOST_LIB_LOADING_RELOADABLE, BOOST_LIB_INIT_AUTO )
+#endif // BOOST_GIL_EXTERNAL_LIB
 
-    struct gil_io_lib_guard {};
 
-#else  // BOOST_GIL_USE_NATIVE_IO
+#if BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_LOADTIME_OR_STATIC
 
-    #ifndef BOOST_GIL_EXTERNAL_LIB
-        //#define BOOST_GIL_EXTERNAL_LIB DynamicLinkAutoLoadAutoInitialize
-        #define BOOST_GIL_EXTERNAL_LIB ( BOOST_LIB_LINK_RUNTIME_AUTO_LOAD, BOOST_LIB_LOADING_RELOADABLE, BOOST_LIB_INIT_AUTO )
-    #endif // BOOST_GIL_EXTERNAL_LIB
+    #pragma comment( lib, "gdiplus.lib" )
+    //...consider adding specific version support via embedded manifests like this:
+    //#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.Windows.GdiPlus' version='1.1.6001.22170' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"" )
 
+    struct gp_guard_base {};
 
-    #if BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_LOADTIME_OR_STATIC
-
-        #pragma comment( lib, "gdiplus.lib" )
-        //...consider adding specific version support via embedded manifests like this:
-        //#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.Windows.GdiPlus' version='1.1.6001.22170' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"" )
-
-        struct gp_guard_base {};
-
-        namespace detail
-        {
-            typedef dummy_lib_guard gil_io_lib_guard_base;
-        }
-
-    #else // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_LOADTIME_OR_STATIC
-
-    } // namespace gil
-
-    inline void win32_lib_handle::ensure() const
+    namespace detail
     {
-        gil::io_error_if( !lib_handle(), "Boost.GIL failed to load external library." );
+        typedef dummy_lib_guard gil_io_lib_guard_base;
     }
 
-    } // namespace boost
+#else // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_LOADTIME_OR_STATIC
 
-    namespace Gdiplus
-    {
-    namespace DllExports
-    {
+} // namespace gil
 
-    #define ALWAYS 1
+inline void win32_lib_handle::ensure() const
+{
+    gil::io_error_if( !lib_handle(), "Boost.GIL failed to load external library." );
+}
 
-    #if GDIPVER >= 0x0110
-        #define GP1_1 1
-    #else
-        #define GP1_1 0
-    #endif
-
-    #define GP_FUNCTION( function_name ) Gdiplus::GpStatus, WINGDIPAPI, function_name
-
-    BOOST_DELAYED_EXTERN_LIB_GUARD
-    (
-        gdiplus.dll,
-        gp_guard_base,
-        BOOST_GIL_EXTERNAL_LIB,
-        (( ALWAYS, Gdiplus::Status, WINAPI, GdiplusStartup     , ( ULONG_PTR * )( const Gdiplus::GdiplusStartupInput * )( Gdiplus::GdiplusStartupOutput * )                                                    ))
-        (( ALWAYS, VOID           , WINAPI, GdiplusShutdown    , ( ULONG_PTR )                                                                                                                                 ))
-        (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromStreamICM ), ( IStream * )( Gdiplus::GpBitmap ** )                                                                                                         ))
-        (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromFileICM   ), ( GDIPCONST WCHAR* )( Gdiplus::GpBitmap ** )                                                                                                  ))
-        (( ALWAYS, GP_FUNCTION( GdipDisposeImage              ), ( Gdiplus::GpImage * )                                                                                                                        ))
-        (( ALWAYS, GP_FUNCTION( GdipGetImageDimension         ), ( Gdiplus::GpImage * )( Gdiplus::REAL * )( Gdiplus::REAL * )                                                                                  ))
-        (( ALWAYS, GP_FUNCTION( GdipGetImagePixelFormat       ), ( Gdiplus::GpImage * )( Gdiplus::PixelFormat * )                                                                                              ))
-        (( ALWAYS, GP_FUNCTION( GdipBitmapLockBits            ), ( Gdiplus::GpBitmap* )( GDIPCONST Gdiplus::GpRect* )( UINT )( Gdiplus::PixelFormat )( Gdiplus::BitmapData* )                                  ))
-        (( ALWAYS, GP_FUNCTION( GdipBitmapUnlockBits          ), ( Gdiplus::GpBitmap* )( Gdiplus::BitmapData* )                                                                                                ))
-        (( ALWAYS, GP_FUNCTION( GdipSaveImageToFile           ), ( Gdiplus::GpImage * )( GDIPCONST WCHAR* )( GDIPCONST CLSID* )( GDIPCONST Gdiplus::EncoderParameters* )                                       ))
-        (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromScan0     ), ( INT )( INT )( INT )( Gdiplus::PixelFormat )( BYTE * )( Gdiplus::GpBitmap** )                                                                ))
-        (( GP1_1 , GP_FUNCTION( GdipInitializePalette         ), ( OUT Gdiplus::ColorPalette * )( Gdiplus::PaletteType )( INT )( BOOL )( Gdiplus::GpBitmap * )                                                 ))
-        (( GP1_1 , GP_FUNCTION( GdipBitmapConvertFormat       ), ( IN Gdiplus::GpBitmap * )( Gdiplus::PixelFormat )( Gdiplus::DitherType )( Gdiplus::PaletteType )( Gdiplus::ColorPalette * )( Gdiplus::REAL ) ))
-    );
-
-    #undef ALWAYS
-    #undef GP1_1
-    #undef GP_FUNCTION
+} // namespace boost
 
-    }
+namespace Gdiplus
+{
+namespace DllExports
+{
 
-    // ...argh...GDI+ puts all functions in the DllExports namespace (hides the
-    // 'flat API') except the following two. The BOOST_DELAYED_EXTERN_LIB_GUARD
-    // macro does not support that level of customization so we must trivially
-    // reimplement these two here...
-    extern "C" Status WINAPI GdiplusStartup 
-    (
-        OUT ULONG_PTR * const token,
-        const GdiplusStartupInput * const input,
-        OUT GdiplusStartupOutput * const output
-    )
-    {
-        return DllExports::GdiplusStartup( token, input, output );
-    }
+#define ALWAYS 1
 
-    extern "C" VOID WINAPI GdiplusShutdown( ULONG_PTR const token )
-    {
-        return DllExports::GdiplusShutdown( token );
-    }
+#if GDIPVER >= 0x0110
+    #define GP1_1 1
+#else
+    #define GP1_1 0
+#endif
+
+#define GP_FUNCTION( function_name ) Gdiplus::GpStatus, WINGDIPAPI, function_name
+
+BOOST_DELAYED_EXTERN_LIB_GUARD
+(
+    gdiplus.dll,
+    gp_guard_base,
+    BOOST_GIL_EXTERNAL_LIB,
+    (( ALWAYS, Gdiplus::Status, WINAPI, GdiplusStartup     , ( ULONG_PTR * )( const Gdiplus::GdiplusStartupInput * )( Gdiplus::GdiplusStartupOutput * )                                                    ))
+    (( ALWAYS, VOID           , WINAPI, GdiplusShutdown    , ( ULONG_PTR )                                                                                                                                 ))
+    (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromStreamICM ), ( IStream * )( Gdiplus::GpBitmap ** )                                                                                                         ))
+    (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromFileICM   ), ( GDIPCONST WCHAR* )( Gdiplus::GpBitmap ** )                                                                                                  ))
+    (( ALWAYS, GP_FUNCTION( GdipDisposeImage              ), ( Gdiplus::GpImage * )                                                                                                                        ))
+    (( ALWAYS, GP_FUNCTION( GdipGetImageDimension         ), ( Gdiplus::GpImage * )( Gdiplus::REAL * )( Gdiplus::REAL * )                                                                                  ))
+    (( ALWAYS, GP_FUNCTION( GdipGetImagePixelFormat       ), ( Gdiplus::GpImage * )( Gdiplus::PixelFormat * )                                                                                              ))
+    (( ALWAYS, GP_FUNCTION( GdipBitmapLockBits            ), ( Gdiplus::GpBitmap* )( GDIPCONST Gdiplus::GpRect* )( UINT )( Gdiplus::PixelFormat )( Gdiplus::BitmapData* )                                  ))
+    (( ALWAYS, GP_FUNCTION( GdipBitmapUnlockBits          ), ( Gdiplus::GpBitmap* )( Gdiplus::BitmapData* )                                                                                                ))
+    (( ALWAYS, GP_FUNCTION( GdipSaveImageToFile           ), ( Gdiplus::GpImage * )( GDIPCONST WCHAR* )( GDIPCONST CLSID* )( GDIPCONST Gdiplus::EncoderParameters* )                                       ))
+    (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromScan0     ), ( INT )( INT )( INT )( Gdiplus::PixelFormat )( BYTE * )( Gdiplus::GpBitmap** )                                                                ))
+    (( GP1_1 , GP_FUNCTION( GdipInitializePalette         ), ( OUT Gdiplus::ColorPalette * )( Gdiplus::PaletteType )( INT )( BOOL )( Gdiplus::GpBitmap * )                                                 ))
+    (( GP1_1 , GP_FUNCTION( GdipBitmapConvertFormat       ), ( IN Gdiplus::GpBitmap * )( Gdiplus::PixelFormat )( Gdiplus::DitherType )( Gdiplus::PaletteType )( Gdiplus::ColorPalette * )( Gdiplus::REAL ) ))
+);
+
+#undef ALWAYS
+#undef GP1_1
+#undef GP_FUNCTION
+
+}
+
+// ...argh...GDI+ puts all functions in the DllExports namespace (hides the
+// 'flat API') except the following two. The BOOST_DELAYED_EXTERN_LIB_GUARD
+// macro does not support that level of customization so we must trivially
+// reimplement these two here...
+extern "C" Status WINAPI GdiplusStartup 
+(
+    OUT ULONG_PTR * const token,
+    const GdiplusStartupInput * const input,
+    OUT GdiplusStartupOutput * const output
+)
+{
+    return DllExports::GdiplusStartup( token, input, output );
+}
 
-    }
+extern "C" VOID WINAPI GdiplusShutdown( ULONG_PTR const token )
+{
+    return DllExports::GdiplusShutdown( token );
+}
 
-    namespace boost
-    {
-    namespace gil
-    {
-    namespace detail
-    {
-        typedef Gdiplus::DllExports::gp_guard_base gp_guard_base;
+}
+
+namespace boost
+{
+namespace gil
+{
+namespace detail
+{
+    typedef Gdiplus::DllExports::gp_guard_base gp_guard_base;
 
-        #if BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_RUNTIME_ASSUME_LOADED
-            // The user/gil_io_lib_guard loads the lib.
-            typedef
-                BOOST_PP_IF
-                (
-                    BOOST_PP_GREATER( BOOST_LIB_LOADING( BOOST_GIL_EXTERNAL_LIB ), BOOST_LIB_LOADING_SINGLE ),
-                    win32_reloadable_lib_guard,
-                    win32_delayloaded_lib_guard
-                ) gil_io_lib_guard_base_helper;
+    #if BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_RUNTIME_ASSUME_LOADED
+        // The user/gil_io_lib_guard loads the lib.
+        typedef
+            BOOST_PP_IF
+            (
+                BOOST_PP_GREATER( BOOST_LIB_LOADING( BOOST_GIL_EXTERNAL_LIB ), BOOST_LIB_LOADING_SINGLE ),
+                win32_reloadable_lib_guard,
+                win32_delayloaded_lib_guard
+            ) gil_io_lib_guard_base_helper;
 
-            class gil_io_lib_guard_base : gil_io_lib_guard_base_helper
+        class gil_io_lib_guard_base : gil_io_lib_guard_base_helper
+        {
+        public:
+            template <typename Char>
+            gil_io_lib_guard_base( Char const * const lib_name )
+                : gil_io_lib_guard_base_helper( lib_name )
             {
-            public:
-                template <typename Char>
-                gil_io_lib_guard_base( Char const * const lib_name )
-                    : gil_io_lib_guard_base_helper( lib_name )
-                {
-                    #if BOOST_LIB_INIT( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_INIT_ASSUME
-                    // The user/gil_io_lib_guard inits the lib so it also has to
-                    // init the function pointers (required for initialization).
-                        gp_guard_base::init_functions( lib_handle() );
-                    #endif // BOOST_LIB_INIT_ASSUME
-                }
-            };
-
-        #else // BOOST_LIB_LINK_RUNTIME_AUTO_LOAD
-            // GIL loads the lib automatically every time.
-            typedef dummy_lib_guard gil_io_lib_guard_base;
+                #if BOOST_LIB_INIT( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_INIT_ASSUME
+                // The user/gil_io_lib_guard inits the lib so it also has to
+                // init the function pointers (required for initialization).
+                    gp_guard_base::init_functions( lib_handle() );
+                #endif // BOOST_LIB_INIT_ASSUME
+            }
+        };
 
-        #endif // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB )
+    #else // BOOST_LIB_LINK_RUNTIME_AUTO_LOAD
+        // GIL loads the lib automatically every time.
+        typedef dummy_lib_guard gil_io_lib_guard_base;
 
-    } // namespace detail
+    #endif // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB )
 
-    #endif // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) != BOOST_LIB_LINK_LOADTIME_OR_STATIC
+} // namespace detail
 
-    namespace detail
-    {
-        class gp_initialize_guard : noncopyable
-        {
-        public:
-            gp_initialize_guard();
-            ~gp_initialize_guard();
-        private:
-            ULONG_PTR gp_token_;
-        };
-    } // namespace detail
+#endif // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) != BOOST_LIB_LINK_LOADTIME_OR_STATIC
 
-    class gil_io_lib_guard
-        :
-        detail::gil_io_lib_guard_base
-        #if BOOST_LIB_INIT( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_INIT_ASSUME
-            ,detail::gp_initialize_guard
-        #endif // BOOST_LIB_INIT_ASSUME
+namespace detail
+{
+    class gp_initialize_guard : noncopyable
     {
     public:
-        gil_io_lib_guard() : detail::gil_io_lib_guard_base( L"gdiplus.dll" ) {}
+        gp_initialize_guard();
+        ~gp_initialize_guard();
+    private:
+        ULONG_PTR gp_token_;
     };
+} // namespace detail
 
-    #undef BOOST_GIL_GUARD_HELPER
+class gil_io_lib_guard
+    :
+    detail::gil_io_lib_guard_base
+    #if BOOST_LIB_INIT( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_INIT_ASSUME
+        ,detail::gp_initialize_guard
+    #endif // BOOST_LIB_INIT_ASSUME
+{
+public:
+    gil_io_lib_guard() : detail::gil_io_lib_guard_base( L"gdiplus.dll" ) {}
+};
 
-#endif // BOOST_GIL_USE_NATIVE_IO
 
 //------------------------------------------------------------------------------
 } // namespace gil
Deleted: sandbox/gil/boost/gil/extension/io2/extern_lib.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/extern_lib.hpp	2010-07-17 06:40:43 EDT (Sat, 17 Jul 2010)
+++ (empty file)
@@ -1,388 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \file extern_lib.hpp
-/// --------------------
-///
-/// BOOST_DELAYED_EXTERN_LIB_GUARD helper macro for reducing boilerplate code
-/// related to dynamic/run-time linking.
-///
-/// Copyright (c) Domagoj Saric 2010.
-///
-///  Use, modification and distribution is subject to the Boost Software License, Version 1.0.
-///  (See accompanying file LICENSE_1_0.txt or copy at
-///  http://www.boost.org/LICENSE_1_0.txt)
-///
-/// For more information, see http://www.boost.org
-////////////////////////////////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-#pragma once
-#ifndef extern_lib_hpp__EAE6695D_91B6_4E14_A3B9_9931BA3FB3B3
-#define extern_lib_hpp__EAE6695D_91B6_4E14_A3B9_9931BA3FB3B3
-//------------------------------------------------------------------------------
-#include <boost/assert.hpp>
-#include <boost/concept_check.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/optional.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/comparison/equal.hpp>
-#include <boost/preprocessor/control/expr_if.hpp>
-#include <boost/preprocessor/control/if.hpp>
-#include <boost/preprocessor/facilities/expand.hpp>
-#include <boost/preprocessor/punctuation/comma_if.hpp>
-#include <boost/preprocessor/seq/enum.hpp>
-#include <boost/preprocessor/seq/for_each.hpp>
-#include <boost/preprocessor/seq/for_each_i.hpp>
-#include <boost/preprocessor/stringize.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
-#include <boost/utility/in_place_factory.hpp>
-
-#ifdef _WIN32
-    #include "windows.h"
-#else // _WIN32
-    ...do implement...
-#endif // platform switch
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Configuration macros
-//
-////////////////////////////////////////////////////////////////////////////////
-
-#define BOOST_LIB_LINK_LOADTIME_OR_STATIC    1
-#define BOOST_LIB_LINK_RUNTIME_ASSUME_LOADED 2
-#define BOOST_LIB_LINK_RUNTIME_AUTO_LOAD     3
-
-#define BOOST_LIB_LOADING_STATIC             1
-#define BOOST_LIB_LOADING_SINGLE             2
-#define BOOST_LIB_LOADING_RELOADABLE         3
-
-#define BOOST_LIB_INIT_ASSUME                1
-#define BOOST_LIB_INIT_AUTO                  2
-
-// Usage example:
-// #define BOOST_GIL_EXTERNAL_LIB ( BOOST_LIB_LINK_RUNTIME_ASSUME_LOADED, BOOST_LIB_LOADING_RELOADABLE, BOOST_LIB_INIT_AUTO )
-
-
-//...or maybe provide the above options merged...something like this:
-//#define StaticallyLinkAssumeInitialized       0
-//#define StaticallyLinkAutoInitialized         1
-//#define DynamicLinkAssumeLoadedAndInitialized 2
-//#define DynamicLinkAssumeLoadedAutoInitialize 3
-//#define DynamicLinkAutoLoadAutoInitialize     4
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Base guard classes
-//
-////////////////////////////////////////////////////////////////////////////////
-
-class win32_lib_handle : noncopyable
-{
-public:
-    HMODULE lib_handle() const { return lib_handle_; }
-
-    static HMODULE loaded_lib_handle( char    const * const lib_name ) { return ::GetModuleHandleA( lib_name ); }
-    static HMODULE loaded_lib_handle( wchar_t const * const lib_name ) { return ::GetModuleHandleW( lib_name ); }
-
-    template <typename T>
-    static T checked_proc_address( HMODULE const lib_handle, char const * const function_name )
-    {
-        BOOST_ASSERT( lib_handle );
-        FARPROC const funcion_address( ::GetProcAddress( lib_handle, function_name ) );
-        BOOST_ASSERT( funcion_address && "Requested function not exported by the library." );
-        return reinterpret_cast<T>( *funcion_address );
-    }
-
-    template <typename T>
-    T checked_proc_address( char const * const function_name ) const
-    {
-        return checked_proc_address<T>( lib_handle(), function_name );
-    }
-
-protected:
-    win32_lib_handle( HMODULE const lib_handle ) : lib_handle_( lib_handle ) {}
-    ~win32_lib_handle() {}
-
-    void ensure() const; //...implement later as desired...
-    void verify() const { BOOST_ASSERT( lib_handle() && "Library not loaded." ); }
-
-private:
-    HMODULE const lib_handle_;
-};
-
-
-class win32_preloaded_reloadable_lib : public win32_lib_handle
-{
-public:
-    win32_preloaded_reloadable_lib( char    const * const lib_name ) : win32_lib_handle( loaded_lib_handle( lib_name ) ) { verify(); }
-    win32_preloaded_reloadable_lib( wchar_t const * const lib_name ) : win32_lib_handle( loaded_lib_handle( lib_name ) ) { verify(); }
-};
-
-
-class win32_preloaded_delayloaded_lib
-{
-public:
-    win32_preloaded_delayloaded_lib( char const * const lib_name )
-    {
-        if ( !delayed_lib_.is_initialized() )
-            delayed_lib_ = in_place( lib_name );
-        else
-            BOOST_ASSERT
-            (
-                ( delayed_lib_->lib_handle() == win32_preloaded_reloadable_lib( lib_name ).lib_handle() ) &&
-                "Library reloaded/relocated!"
-            );
-    }
-
-    win32_preloaded_delayloaded_lib( wchar_t const * const lib_name )
-    {
-        if ( !delayed_lib_.is_initialized() )
-            delayed_lib_ = in_place( lib_name );
-        else
-            BOOST_ASSERT
-            (
-                ( delayed_lib_->lib_handle() == win32_preloaded_reloadable_lib( lib_name ).lib_handle() ) &&
-                "Library reloaded/relocated!"
-            );
-    }
-
-    static HMODULE lib_handle() { return delayed_lib_->lib_handle(); }
-
-    static HMODULE loaded_lib_handle( char    const * const lib_name )
-    {
-        BOOST_ASSERT( win32_lib_handle::loaded_lib_handle( lib_name ) == lib_handle() );
-        ignore_unused_variable_warning( lib_name );
-        return lib_handle();
-    }
-    static HMODULE loaded_lib_handle( wchar_t const * const lib_name )
-    {
-        BOOST_ASSERT( win32_lib_handle::loaded_lib_handle( lib_name ) == lib_handle() );
-        ignore_unused_variable_warning( lib_name );
-        return lib_handle();
-    }
-
-private:
-    static optional<win32_preloaded_reloadable_lib> delayed_lib_;
-};
-
-__declspec( selectany )
-optional<win32_preloaded_reloadable_lib> win32_preloaded_delayloaded_lib::delayed_lib_;
-
-
-class win32_reloadable_lib_guard : public win32_lib_handle
-{
-public:
-    win32_reloadable_lib_guard( char    const * const lib_name ) : win32_lib_handle( ::LoadLibraryA( lib_name ) ) { ensure(); }
-    win32_reloadable_lib_guard( wchar_t const * const lib_name ) : win32_lib_handle( ::LoadLibraryW( lib_name ) ) { ensure(); }
-
-    ~win32_reloadable_lib_guard() { BOOST_VERIFY( ::FreeLibrary( lib_handle() ) ); }
-};
-
-
-class win32_delayloaded_lib_guard
-{
-public:
-    win32_delayloaded_lib_guard( char const * const lib_name )
-    {
-        if ( !delayed_lib_.is_initialized() )
-            delayed_lib_ = in_place( lib_name );
-        else
-            BOOST_ASSERT
-            (
-                ( delayed_lib_->lib_handle() == win32_reloadable_lib_guard( lib_name ).lib_handle() ) &&
-                "Library reloaded/relocated!"
-            );
-    }
-
-    win32_delayloaded_lib_guard( wchar_t const * const lib_name )
-    {
-        if ( !delayed_lib_.is_initialized() )
-            delayed_lib_ = in_place( lib_name );
-        else
-            BOOST_ASSERT
-            (
-                ( delayed_lib_->lib_handle() == win32_reloadable_lib_guard( lib_name ).lib_handle() ) &&
-                "Library reloaded/relocated!"
-            );
-    }
-
-    static HMODULE lib_handle() { return delayed_lib_->lib_handle(); }
-
-    static HMODULE loaded_lib_handle( char    const * const lib_name )
-    {
-        BOOST_ASSERT( win32_lib_handle::loaded_lib_handle( lib_name ) == lib_handle() );
-        ignore_unused_variable_warning( lib_name );
-        return lib_handle();
-    }
-    static HMODULE loaded_lib_handle( wchar_t const * const lib_name )
-    {
-        BOOST_ASSERT( win32_lib_handle::loaded_lib_handle( lib_name ) == lib_handle() );
-        ignore_unused_variable_warning( lib_name );
-        return lib_handle();
-    }
-
-private:
-    static optional<win32_reloadable_lib_guard> delayed_lib_;
-};
-
-__declspec( selectany )
-optional<win32_reloadable_lib_guard> win32_delayloaded_lib_guard::delayed_lib_;
-
-
-class dummy_lib_guard
-{
-public:
-    dummy_lib_guard( char    const * /*lib_name*/ ) {}
-    dummy_lib_guard( wchar_t const * /*lib_name*/ ) {}
-
-    static HMODULE loaded_lib_handle( char    const * const lib_name ) { return win32_lib_handle::loaded_lib_handle( lib_name ); }
-    static HMODULE loaded_lib_handle( wchar_t const * const lib_name ) { return win32_lib_handle::loaded_lib_handle( lib_name ); }
-};
-
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Preprocessor section
-//
-////////////////////////////////////////////////////////////////////////////////
-
-#define BOOST_LIB_LINK(    option ) BOOST_PP_TUPLE_ELEM( 3, 0, option )
-#define BOOST_LIB_LOADING( option ) BOOST_PP_TUPLE_ELEM( 3, 1, option )
-#define BOOST_LIB_INIT(    option ) BOOST_PP_TUPLE_ELEM( 3, 2, option )
-
-#define BOOST_LIB_GUARD_FOR_LINK_TYPE( type )                                                  \
-    BOOST_PP_EXPR_IF                                                                           \
-    (                                                                                          \
-        BOOST_PP_EQUAL( BOOST_LIB_LINK( type ), BOOST_LIB_LINK_LOADTIME_OR_STATIC ),           \
-        no need for a lib guard with load time or static linking                               \
-    )                                                                                          \
-    BOOST_PP_IF                                                                                \
-    (                                                                                          \
-        BOOST_PP_EQUAL( BOOST_LIB_INIT( type ), BOOST_LIB_INIT_ASSUME ),                       \
-        dummy_lib_guard,                                                                       \
-        BOOST_PP_IF                                                                            \
-        (                                                                                      \
-            BOOST_PP_EQUAL( BOOST_LIB_LINK( type ), BOOST_LIB_LINK_RUNTIME_ASSUME_LOADED ),    \
-            BOOST_PP_IF                                                                        \
-            (                                                                                  \
-                BOOST_PP_EQUAL( BOOST_LIB_LOADING( type ), BOOST_LIB_LOADING_SINGLE ),         \
-                win32_preloaded_delayloaded_lib,                                               \
-                win32_preloaded_reloadable_lib                                                 \
-            ),                                                                                 \
-            BOOST_PP_IF                                                                        \
-            (                                                                                  \
-                BOOST_PP_EQUAL( BOOST_LIB_LOADING( type ), BOOST_LIB_LOADING_SINGLE ),         \
-                win32_delayloaded_lib_guard,                                                   \
-                win32_reloadable_lib_guard                                                     \
-            )                                                                                  \
-        )                                                                                      \
-    )
-
-
-#define BOOST_DELAYED_EXTERN_LIB_FUNCTION_TYPEDEF_AND_POINTER_WORKER( condition, return_type, call_convention, function_name, parameter_sequence )   \
-    BOOST_PP_EXPR_IF                                                                                                                                 \
-    (                                                                                                                                                \
-        condition,                                                                                                                                   \
-        typedef return_type ( call_convention & BOOST_PP_CAT( P, function_name ) ) ( BOOST_PP_SEQ_ENUM( parameter_sequence ) ) throw();              \
-                return_type ( call_convention & BOOST_PP_CAT( p, function_name ) ) ( BOOST_PP_SEQ_ENUM( parameter_sequence ) ) throw();              \
-    )
-
-#define BOOST_DELAYED_EXTERN_LIB_FUNCTION_TYPEDEF_AND_POINTER( r, dummy, element )   \
-    BOOST_DELAYED_EXTERN_LIB_FUNCTION_TYPEDEF_AND_POINTER_WORKER( BOOST_PP_TUPLE_ELEM( 5, 0, element ), BOOST_PP_TUPLE_ELEM( 5, 1, element ), BOOST_PP_TUPLE_ELEM( 5, 2, element ), BOOST_PP_TUPLE_ELEM( 5, 3, element ), BOOST_PP_TUPLE_ELEM( 5, 4, element ) )
-
-
-#define BOOST_DELAYED_EXTERN_LIB_FUNCTION_PARAMETERS( r, data, index, parameter )   \
-    BOOST_PP_COMMA_IF( index )                                                      \
-    parameter BOOST_PP_CAT( prm, index )
-
-
-#define BOOST_DELAYED_EXTERN_LIB_FUNCTION_ARGUMENTS( r, data, index, parameter )   \
-    BOOST_PP_COMMA_IF( index )                                                     \
-    BOOST_PP_CAT( prm, index )
-
-
-#define BOOST_DELAYED_EXTERN_LIB_FUNCTION_IMPLEMENTATION_WORKER( condition, guard_class_name, return_type, call_convention, function_name, parameter_sequence )   \
-    BOOST_PP_EXPR_IF                                                                                                                                 \
-    (                                                                                                                                                \
-        condition,                                                                                                                                   \
-        inline __declspec( nothrow ) return_type call_convention function_name( BOOST_PP_SEQ_FOR_EACH_I( BOOST_DELAYED_EXTERN_LIB_FUNCTION_PARAMETERS, 0, parameter_sequence ) ) {          \
-            return guard_class_name::lib_functions().BOOST_PP_CAT( p, function_name )( BOOST_PP_SEQ_FOR_EACH_I( BOOST_DELAYED_EXTERN_LIB_FUNCTION_ARGUMENTS, 0, parameter_sequence ) ); }   \
-    )
-
-#define BOOST_DELAYED_EXTERN_LIB_FUNCTION_IMPLEMENTATION( r, guard_class_name, element )   \
-    BOOST_DELAYED_EXTERN_LIB_FUNCTION_IMPLEMENTATION_WORKER( BOOST_PP_TUPLE_ELEM( 5, 0, element ), guard_class_name, BOOST_PP_TUPLE_ELEM( 5, 1, element ), BOOST_PP_TUPLE_ELEM( 5, 2, element ), BOOST_PP_TUPLE_ELEM( 5, 3, element ), BOOST_PP_TUPLE_ELEM( 5, 4, element ) )
-
-
-#define BOOST_DELAYED_EXTERN_LIB_FUNCTION_LOAD_WORKER( function_name )                                                                                                     \
-    BOOST_PP_CAT( p, function_name )( boost::win32_lib_handle::checked_proc_address<BOOST_PP_CAT( P, function_name )>( lib_handle, BOOST_PP_STRINGIZE( function_name ) ) )
-
-#define BOOST_DELAYED_EXTERN_LIB_FUNCTION_LOAD( r, data, index, function_tuple )        \
-    BOOST_PP_EXPR_IF                                                                    \
-    (                                                                                   \
-        BOOST_PP_TUPLE_ELEM( 5, 0, function_tuple ),                                    \
-        BOOST_PP_COMMA_IF( index )                                                      \
-        BOOST_DELAYED_EXTERN_LIB_FUNCTION_LOAD_WORKER                                   \
-        (                                                                               \
-            BOOST_PP_TUPLE_ELEM( 5, 3, function_tuple )                                 \
-        )                                                                               \
-    )
-
-
-#define BOOST_DELAYED_EXTERN_LIB_GUARD( lib_name, guard_class_name, guard_option, functionSequence )                \
-    class guard_class_name : public boost:: BOOST_LIB_GUARD_FOR_LINK_TYPE( guard_option )                           \
-    {                                                                                                               \
-    private:                                                                                                        \
-        struct functions : ::boost::noncopyable                                                                     \
-        {                                                                                                           \
-            BOOST_PP_SEQ_FOR_EACH( BOOST_DELAYED_EXTERN_LIB_FUNCTION_TYPEDEF_AND_POINTER, 0 , functionSequence );   \
-                                                                                                                    \
-            functions( HMODULE const lib_handle )                                                                   \
-                :                                                                                                   \
-                BOOST_PP_SEQ_FOR_EACH_I( BOOST_DELAYED_EXTERN_LIB_FUNCTION_LOAD, 0 , functionSequence )             \
-            {}                                                                                                      \
-        };                                                                                                          \
-        template <int dummy = 0>                                                                                    \
-        struct functions_singleton : ::boost::noncopyable                                                           \
-        {                                                                                                           \
-            static void create( HMODULE const lib_handle )                                                          \
-            {                                                                                                       \
-                if ( !functions_.is_initialized() )                                                                 \
-                    functions_ = boost::in_place( lib_handle );                                                     \
-            }                                                                                                       \
-            static functions const & lib_functions() { return *functions_; }                                        \
-        private:                                                                                                    \
-            static boost::optional<functions> functions_;                                                           \
-        };                                                                                                          \
-    public:                                                                                                         \
-        guard_class_name() : boost:: BOOST_LIB_GUARD_FOR_LINK_TYPE( guard_option ) ( L#lib_name )                   \
-        {                                                                                                           \
-            BOOST_PP_EXPR_IF                                                                                        \
-            (                                                                                                       \
-                BOOST_PP_EQUAL( BOOST_LIB_INIT( guard_option ), BOOST_LIB_INIT_AUTO ),                              \
-                functions_singleton<>::create( lib_handle() );                                                      \
-            )                                                                                                       \
-        }                                                                                                           \
-        static void init_functions( HMODULE const lib_handle ) { functions_singleton<>::create( lib_handle ); }     \
-        static void init_functions() { functions_singleton<>::create( loaded_lib_handle( L#lib_name ) ); }          \
-        static functions const & lib_functions() { return functions_singleton<>::lib_functions(); }                 \
-    };                                                                                                              \
-                                                                                                                    \
-template <int dummy>                                                                                                \
-__declspec( selectany )                                                                                             \
-boost::optional<guard_class_name::functions> guard_class_name::functions_singleton<dummy>::functions_;              \
-                                                                                                                    \
-BOOST_PP_SEQ_FOR_EACH( BOOST_DELAYED_EXTERN_LIB_FUNCTION_IMPLEMENTATION, guard_class_name, functionSequence );      \
-/**/
-
-
-//------------------------------------------------------------------------------
-} // namespace boost
-//------------------------------------------------------------------------------
-#endif // extern_lib_hpp
Deleted: sandbox/gil/boost/gil/extension/io2/extern_lib_guard.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/extern_lib_guard.hpp	2010-07-17 06:40:43 EDT (Sat, 17 Jul 2010)
+++ (empty file)
@@ -1,216 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \file extern_lib_guard.hpp
-/// --------------------------
-///
-/// Copyright (c) Domagoj Saric 2010.
-///
-///  Use, modification and distribution is subject to the Boost Software License, Version 1.0.
-///  (See accompanying file LICENSE_1_0.txt or copy at
-///  http://www.boost.org/LICENSE_1_0.txt)
-///
-/// For more information, see http://www.boost.org
-////////////////////////////////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-#pragma once
-#ifndef extern_lib_guard_hpp__5C845C6C_F8AE_422B_A041_BA78815FCDD3
-#define extern_lib_guard_hpp__5C845C6C_F8AE_422B_A041_BA78815FCDD3
-//------------------------------------------------------------------------------
-#include "extern_lib.hpp"
-#include "io_error.hpp"
-
-#include <boost/preprocessor/comparison/greater.hpp>
-
-#include "objbase.h"
-#ifdef NOMINMAX
-    // ...yuck... hacks needed because of GDIPlus...
-    #define max(a, b) (((a) > (b)) ? (a) : (b))
-    #define min(a, b) (((a) < (b)) ? (a) : (b))
-#endif // NOMINMAX
-#include "gdiplus.h"
-#ifdef NOMINMAX
-    #undef  max
-    #undef  min
-#endif // NOMINMAX
-//------------------------------------------------------------------------------
-namespace boost
-{
-//------------------------------------------------------------------------------
-namespace gil
-{
-//------------------------------------------------------------------------------
-
-#ifndef BOOST_GIL_USE_NATIVE_IO
-
-    struct gil_io_lib_guard {};
-
-#else  // BOOST_GIL_USE_NATIVE_IO
-
-    #ifndef BOOST_GIL_EXTERNAL_LIB
-        //#define BOOST_GIL_EXTERNAL_LIB DynamicLinkAutoLoadAutoInitialize
-        #define BOOST_GIL_EXTERNAL_LIB ( BOOST_LIB_LINK_RUNTIME_AUTO_LOAD, BOOST_LIB_LOADING_RELOADABLE, BOOST_LIB_INIT_AUTO )
-    #endif // BOOST_GIL_EXTERNAL_LIB
-
-
-    #if BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_LOADTIME_OR_STATIC
-
-        #pragma comment( lib, "gdiplus.lib" )
-        //...consider adding specific version support via embedded manifests like this:
-        //#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.Windows.GdiPlus' version='1.1.6001.22170' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"" )
-
-        struct gp_guard_base {};
-
-        namespace detail
-        {
-            typedef dummy_lib_guard gil_io_lib_guard_base;
-        }
-
-    #else // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_LOADTIME_OR_STATIC
-
-    } // namespace gil
-
-    inline void win32_lib_handle::ensure() const
-    {
-        gil::io_error_if( !lib_handle(), "Boost.GIL failed to load external library." );
-    }
-
-    } // namespace boost
-
-    namespace Gdiplus
-    {
-    namespace DllExports
-    {
-
-    #define ALWAYS 1
-
-    #if GDIPVER >= 0x0110
-        #define GP1_1 1
-    #else
-        #define GP1_1 0
-    #endif
-
-    #define GP_FUNCTION( function_name ) Gdiplus::GpStatus, WINGDIPAPI, function_name
-
-    BOOST_DELAYED_EXTERN_LIB_GUARD
-    (
-        gdiplus.dll,
-        gp_guard_base,
-        BOOST_GIL_EXTERNAL_LIB,
-        (( ALWAYS, Gdiplus::Status, WINAPI, GdiplusStartup     , ( ULONG_PTR * )( const Gdiplus::GdiplusStartupInput * )( Gdiplus::GdiplusStartupOutput * )                                                    ))
-        (( ALWAYS, VOID           , WINAPI, GdiplusShutdown    , ( ULONG_PTR )                                                                                                                                 ))
-        (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromStreamICM ), ( IStream * )( Gdiplus::GpBitmap ** )                                                                                                         ))
-        (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromFileICM   ), ( GDIPCONST WCHAR* )( Gdiplus::GpBitmap ** )                                                                                                  ))
-        (( ALWAYS, GP_FUNCTION( GdipDisposeImage              ), ( Gdiplus::GpImage * )                                                                                                                        ))
-        (( ALWAYS, GP_FUNCTION( GdipGetImageDimension         ), ( Gdiplus::GpImage * )( Gdiplus::REAL * )( Gdiplus::REAL * )                                                                                  ))
-        (( ALWAYS, GP_FUNCTION( GdipGetImagePixelFormat       ), ( Gdiplus::GpImage * )( Gdiplus::PixelFormat * )                                                                                              ))
-        (( ALWAYS, GP_FUNCTION( GdipBitmapLockBits            ), ( Gdiplus::GpBitmap* )( GDIPCONST Gdiplus::GpRect* )( UINT )( Gdiplus::PixelFormat )( Gdiplus::BitmapData* )                                  ))
-        (( ALWAYS, GP_FUNCTION( GdipBitmapUnlockBits          ), ( Gdiplus::GpBitmap* )( Gdiplus::BitmapData* )                                                                                                ))
-        (( ALWAYS, GP_FUNCTION( GdipSaveImageToFile           ), ( Gdiplus::GpImage * )( GDIPCONST WCHAR* )( GDIPCONST CLSID* )( GDIPCONST Gdiplus::EncoderParameters* )                                       ))
-        (( ALWAYS, GP_FUNCTION( GdipCreateBitmapFromScan0     ), ( INT )( INT )( INT )( Gdiplus::PixelFormat )( BYTE * )( Gdiplus::GpBitmap** )                                                                ))
-        (( GP1_1 , GP_FUNCTION( GdipInitializePalette         ), ( OUT Gdiplus::ColorPalette * )( Gdiplus::PaletteType )( INT )( BOOL )( Gdiplus::GpBitmap * )                                                 ))
-        (( GP1_1 , GP_FUNCTION( GdipBitmapConvertFormat       ), ( IN Gdiplus::GpBitmap * )( Gdiplus::PixelFormat )( Gdiplus::DitherType )( Gdiplus::PaletteType )( Gdiplus::ColorPalette * )( Gdiplus::REAL ) ))
-    );
-
-    #undef ALWAYS
-    #undef GP1_1
-    #undef GP_FUNCTION
-
-    }
-
-    // ...argh...GDI+ puts all functions in the DllExports namespace (hides the
-    // 'flat API') except the following two. The BOOST_DELAYED_EXTERN_LIB_GUARD
-    // macro does not support that level of customization so we must trivially
-    // reimplement these two here...
-    extern "C" Status WINAPI GdiplusStartup 
-    (
-        OUT ULONG_PTR * const token,
-        const GdiplusStartupInput * const input,
-        OUT GdiplusStartupOutput * const output
-    )
-    {
-        return DllExports::GdiplusStartup( token, input, output );
-    }
-
-    extern "C" VOID WINAPI GdiplusShutdown( ULONG_PTR const token )
-    {
-        return DllExports::GdiplusShutdown( token );
-    }
-
-    }
-
-    namespace boost
-    {
-    namespace gil
-    {
-    namespace detail
-    {
-        typedef Gdiplus::DllExports::gp_guard_base gp_guard_base;
-
-        #if BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_LINK_RUNTIME_ASSUME_LOADED
-            // The user/gil_io_lib_guard loads the lib.
-            typedef
-                BOOST_PP_IF
-                (
-                    BOOST_PP_GREATER( BOOST_LIB_LOADING( BOOST_GIL_EXTERNAL_LIB ), BOOST_LIB_LOADING_SINGLE ),
-                    win32_reloadable_lib_guard,
-                    win32_delayloaded_lib_guard
-                ) gil_io_lib_guard_base_helper;
-
-            class gil_io_lib_guard_base : gil_io_lib_guard_base_helper
-            {
-            public:
-                template <typename Char>
-                gil_io_lib_guard_base( Char const * const lib_name )
-                    : gil_io_lib_guard_base_helper( lib_name )
-                {
-                    #if BOOST_LIB_INIT( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_INIT_ASSUME
-                    // The user/gil_io_lib_guard inits the lib so it also has to
-                    // init the function pointers (required for initialization).
-                        gp_guard_base::init_functions( lib_handle() );
-                    #endif // BOOST_LIB_INIT_ASSUME
-                }
-            };
-
-        #else // BOOST_LIB_LINK_RUNTIME_AUTO_LOAD
-            // GIL loads the lib automatically every time.
-            typedef dummy_lib_guard gil_io_lib_guard_base;
-
-        #endif // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB )
-
-    } // namespace detail
-
-    #endif // BOOST_LIB_LINK( BOOST_GIL_EXTERNAL_LIB ) != BOOST_LIB_LINK_LOADTIME_OR_STATIC
-
-    namespace detail
-    {
-        class gp_initialize_guard : noncopyable
-        {
-        public:
-            gp_initialize_guard();
-            ~gp_initialize_guard();
-        private:
-            ULONG_PTR gp_token_;
-        };
-    } // namespace detail
-
-    class gil_io_lib_guard
-        :
-        detail::gil_io_lib_guard_base
-        #if BOOST_LIB_INIT( BOOST_GIL_EXTERNAL_LIB ) == BOOST_LIB_INIT_ASSUME
-            ,detail::gp_initialize_guard
-        #endif // BOOST_LIB_INIT_ASSUME
-    {
-    public:
-        gil_io_lib_guard() : detail::gil_io_lib_guard_base( L"gdiplus.dll" ) {}
-    };
-
-    #undef BOOST_GIL_GUARD_HELPER
-
-#endif // BOOST_GIL_USE_NATIVE_IO
-
-//------------------------------------------------------------------------------
-} // namespace gil
-//------------------------------------------------------------------------------
-} // namespace boost
-//------------------------------------------------------------------------------
-#endif // extern_lib_guard_hpp
Modified: sandbox/gil/boost/gil/extension/io2/gp_private_base.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/gp_private_base.hpp	(original)
+++ sandbox/gil/boost/gil/extension/io2/gp_private_base.hpp	2010-07-17 06:40:43 EDT (Sat, 17 Jul 2010)
@@ -20,7 +20,7 @@
 #define gp_private_base_hpp__3B1ED5BC_42C6_4EC6_B700_01C1B8646431
 //------------------------------------------------------------------------------
 #include "../../gil_all.hpp"
-#include "extern_lib_guard.hpp"
+#include "detail/gp_extern_lib_guard.hpp"
 #include "formatted_image.hpp"
 #include "gp_private_istreams.hpp"
 #include "io_error.hpp"
@@ -30,7 +30,7 @@
 #include <boost/mpl/integral_c.hpp>
 #include <boost/range/iterator_range.hpp>
 #include <boost/static_assert.hpp>
-#include "boost/type_traits/is_pod.hpp"
+#include <boost/type_traits/is_pod.hpp>
 
 #include <algorithm>
 //------------------------------------------------------------------------------
@@ -246,6 +246,8 @@
             new ( optional_roi_.address() ) gp_roi( offset, Width, Height );
         }
 
+        void set_format( format_t const format ) { PixelFormat = format; }
+
         Gdiplus::Rect const * const p_roi_;
 
     private:
@@ -456,12 +458,13 @@
     }
 
 public:
-    template <typename View>
-    void generic_convert_to_prepared_view( View const & view ) const
+    template <class MyView, class TargetView, class Converter>
+    void generic_convert_to_prepared_view( TargetView const & view, Converter const & converter ) const
     {
         BOOST_ASSERT( !dimensions_mismatch( view ) );
         //BOOST_ASSERT( !formats_mismatch   ( view ) );
 
+        using namespace Gdiplus;
         BitmapData bitmapData;
         Rect const rect( 0, 0, bitmapData.Width, bitmapData.Height );
         ensure_result
@@ -471,17 +474,18 @@
                 pBitmap_,
                 &rect,
                 ImageLockModeRead,
-                view_gp_format::apply<View>::value,
+                view_gp_format::apply<MyView>::value,
                 &bitmapData
             )
         );
+        assert( !"converter" );
         copy_pixels // This must not throw!
         (
             interleaved_view
             (
                 bitmapData.Width ,
                 bitmapData.Height,
-                gil_reinterpret_cast_c<typename View::value_type const *>( bitmapData.Scan0 ),
+                gil_reinterpret_cast_c<typename MyView::value_type const *>( bitmapData.Scan0 ),
                 bitmapData.Stride
             ),
             view