$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r67572 - in sandbox/gil/boost/gil/extension/io2: . detail
From: dsaritz_at_[hidden]
Date: 2011-01-02 11:03:37
Author: psiha
Date: 2011-01-02 11:03:31 EST (Sun, 02 Jan 2011)
New Revision: 67572
URL: http://svn.boost.org/trac/boost/changeset/67572
Log:
Added the external platform_specifics.hpp file and used it to cleanup MSVC++ specifics/nonstandard extensions.
Properties modified: 
   sandbox/gil/boost/gil/extension/io2/detail/   (props changed)
Text files modified: 
   sandbox/gil/boost/gil/extension/io2/detail/io_error.hpp                |     5 +++--                                   
   sandbox/gil/boost/gil/extension/io2/detail/windows_shared_istreams.hpp |     4 +++-                                    
   sandbox/gil/boost/gil/extension/io2/formatted_image.hpp                |     7 ++++---                                 
   sandbox/gil/boost/gil/extension/io2/gp_image.hpp                       |    14 +++++++-------                          
   sandbox/gil/boost/gil/extension/io2/libjpeg_image.hpp                  |     5 ++---                                   
   sandbox/gil/boost/gil/extension/io2/libpng_image.hpp                   |    11 ++++++-----                             
   6 files changed, 25 insertions(+), 21 deletions(-)
Modified: sandbox/gil/boost/gil/extension/io2/detail/io_error.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/detail/io_error.hpp	(original)
+++ sandbox/gil/boost/gil/extension/io2/detail/io_error.hpp	2011-01-02 11:03:31 EST (Sun, 02 Jan 2011)
@@ -17,6 +17,8 @@
 #ifndef io_error_hpp__71ED3406_D77C_41FB_9981_A94A1D3BDC8A
 #define io_error_hpp__71ED3406_D77C_41FB_9981_A94A1D3BDC8A
 //------------------------------------------------------------------------------
+#include "platform_specifics.hpp"
+
 #include "boost/throw_exception.hpp"
 
 #include <exception>
@@ -31,8 +33,7 @@
 {
 //------------------------------------------------------------------------------
 
-__declspec( noreturn noalias )
-inline void io_error   ( char const * const description )
+inline BF_NOTHROWNOALIAS void io_error( char const * const description )
 {
     #ifdef _MSC_VER
         throw_exception( std::exception( description , 0 ) ); // Assumes the description string is static/non-temporary
Modified: sandbox/gil/boost/gil/extension/io2/detail/windows_shared_istreams.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/detail/windows_shared_istreams.hpp	(original)
+++ sandbox/gil/boost/gil/extension/io2/detail/windows_shared_istreams.hpp	2011-01-02 11:03:31 EST (Sun, 02 Jan 2011)
@@ -19,6 +19,8 @@
 #ifndef windows_shared_istreams_hpp__A8D022F0_BBFA_4496_8252_8FD1F6A28DF7
 #define windows_shared_istreams_hpp__A8D022F0_BBFA_4496_8252_8FD1F6A28DF7
 //------------------------------------------------------------------------------
+#include "platform_specifics.hpp"
+
 #include "boost/gil/utilities.hpp"
 
 #include "boost/range/iterator_range.hpp"
@@ -378,7 +380,7 @@
             case STREAM_SEEK_SET: return memory_chunk_.begin();
             case STREAM_SEEK_CUR: return pCurrentPosition_    ;
             case STREAM_SEEK_END: return memory_chunk_.end  ();
-            default: assert( false ); __assume( false );
+            default: BF_UNREACHABLE_CODE
         }
     }
 
Modified: sandbox/gil/boost/gil/extension/io2/formatted_image.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/formatted_image.hpp	(original)
+++ sandbox/gil/boost/gil/extension/io2/formatted_image.hpp	2011-01-02 11:03:31 EST (Sun, 02 Jan 2011)
@@ -20,6 +20,7 @@
 #define formatted_image_hpp__C34C1FB0_A4F5_42F3_9318_5805B88CFE49
 //------------------------------------------------------------------------------
 #include "format_tags.hpp"
+#include "detail/platform_specifics.hpp"
 #include "detail/io_error.hpp"
 #include "detail/switch.hpp"
 
@@ -474,7 +475,7 @@
         result_type operator()( Index const & ) const
         {
             BOOST_ASSERT( !"Default case must not have been reached!" );
-            __assume( false );
+            BF_UNREACHABLE_CODE
             return result_type();
         }
     };
@@ -642,8 +643,8 @@
 
 private:
     // ...zzz...MSVC++ 10 generates code to check whether this == 0...investigate...
-    Impl       & impl()       { __assume( this != 0 ); return static_cast<Impl       &>( *this ); }
-    Impl const & impl() const { __assume( this != 0 ); return static_cast<Impl const &>( *this ); }
+    Impl       & impl()       { BF_ASSUME( this != 0 ); return static_cast<Impl       &>( *this ); }
+    Impl const & impl() const { BF_ASSUME( this != 0 ); return static_cast<Impl const &>( *this ); }
 
 protected:
     template <typename View>
Modified: sandbox/gil/boost/gil/extension/io2/gp_image.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/gp_image.hpp	(original)
+++ sandbox/gil/boost/gil/extension/io2/gp_image.hpp	2011-01-02 11:03:31 EST (Sun, 02 Jan 2011)
@@ -131,12 +131,12 @@
     // Programmer errors:
     switch ( status )
     {
-        case Ok                        : BOOST_ASSERT( !"Should not be called for no error" ); __assume( false ); break;
-        case InvalidParameter          : BOOST_ASSERT( !"Invalid parameter"                 ); __assume( false ); break;
-        case WrongState                : BOOST_ASSERT( !"Object in wrong state"             ); __assume( false ); break;
-        case GdiplusNotInitialized     : BOOST_ASSERT( !"GDI+ not initialized"              ); __assume( false ); break;
+        case Ok                        : BOOST_ASSERT( !"Should not be called for no error" ); BF_UNREACHABLE_CODE break;
+        case InvalidParameter          : BOOST_ASSERT( !"Invalid parameter"                 ); BF_UNREACHABLE_CODE break;
+        case WrongState                : BOOST_ASSERT( !"Object in wrong state"             ); BF_UNREACHABLE_CODE break;
+        case GdiplusNotInitialized     : BOOST_ASSERT( !"GDI+ not initialized"              ); BF_UNREACHABLE_CODE break;
 
-        default: BOOST_ASSERT( !"Unknown GDI+ status code." ); __assume( false ); break;
+        default: BOOST_ASSERT( !"Unknown GDI+ status code." ); BF_UNREACHABLE_CODE break;
     }
 }
 
@@ -450,7 +450,7 @@
                 #endif // (GDIPVER >= 0x0110)
 
             default:
-                BOOST_ASSERT( !"Should not get reached." ); __assume( false );
+                BF_UNREACHABLE_CODE
                 return PixelFormatUndefined;
         }
     }
@@ -472,7 +472,7 @@
             #endif
 
             default:
-                BOOST_ASSERT( !"Should not get reached." ); __assume( false );
+                BF_UNREACHABLE_CODE
                 return unsupported_format;
         }
     }
Modified: sandbox/gil/boost/gil/extension/io2/libjpeg_image.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/libjpeg_image.hpp	(original)
+++ sandbox/gil/boost/gil/extension/io2/libjpeg_image.hpp	2011-01-02 11:03:31 EST (Sun, 02 Jan 2011)
@@ -522,7 +522,7 @@
 
             default:
                 BOOST_ASSERT( !"Invalid or unknown format specified." );
-                __assume( false );
+                BF_UNREACHABLE_CODE
                 return 0;
         }
     }
@@ -933,8 +933,7 @@
 
     static boolean __cdecl fill_memory_chunk_buffer( j_decompress_ptr /*p_cinfo*/ )
     {
-        BOOST_ASSERT( !"Should not get called." );
-        __assume( false );
+        BF_UNREACHABLE_CODE
         return true;
     }
 
Modified: sandbox/gil/boost/gil/extension/io2/libpng_image.hpp
==============================================================================
--- sandbox/gil/boost/gil/extension/io2/libpng_image.hpp	(original)
+++ sandbox/gil/boost/gil/extension/io2/libpng_image.hpp	2011-01-02 11:03:31 EST (Sun, 02 Jan 2011)
@@ -18,6 +18,7 @@
 #define libpng_image_hpp__9E0C99E6_EAE8_4D71_844B_93518FFCB5CE
 //------------------------------------------------------------------------------
 #include "formatted_image.hpp"
+#include "detail/platform_specifics.hpp"
 #include "detail/io_error.hpp"
 #include "detail/libx_shared.hpp"
 #include "detail/shared.hpp"
@@ -173,7 +174,7 @@
     {
         BOOST_ASSERT( p_png_ && "Call this only after ensuring creation success!" );
         png_struct & png( *p_png_ );
-        __assume( &png != 0 );
+        BF_ASSUME( &png != 0 );
         return png;
     }
 
@@ -181,7 +182,7 @@
     {
         BOOST_ASSERT( p_png_ && "Call this only after ensuring creation success!" );
         png_info & info( *p_info_ );
-        __assume( &info != 0 );
+        BF_ASSUME( &info != 0 );
         return info;
     }
 
@@ -542,7 +543,7 @@
         #endif // BOOST_GIL_THROW_THROUGH_C_SUPPORTED
 
         unsigned int number_of_passes( ::png_set_interlace_handling( &png_object() ) );
-        __assume( ( number_of_passes == 1 ) || ( number_of_passes == 7 ) );
+        BF_ASSUME( ( number_of_passes == 1 ) || ( number_of_passes == 7 ) );
         BOOST_ASSERT( ( number_of_passes == 1 ) && "Missing interlaced support for the generic conversion case." );
         ignore_unused_variable_warning( number_of_passes );
 
@@ -631,7 +632,7 @@
         #endif // BOOST_GIL_THROW_THROUGH_C_SUPPORTED
 
         unsigned int number_of_passes( ::png_set_interlace_handling( &png_object() ) );
-        __assume( ( number_of_passes == 1 ) || ( number_of_passes == 7 ) );
+        BF_ASSUME( ( number_of_passes == 1 ) || ( number_of_passes == 7 ) );
 
         skip_rows( view_data.offset_ );
 
@@ -689,7 +690,7 @@
         unsigned int number_of_rows_to_skip( row_to_skip_to - png_object().row_number );
         while ( number_of_rows_to_skip-- )
         {
-            __assume( row_to_skip_to != 0 );
+            BF_ASSUME( row_to_skip_to != 0 );
             read_row( NULL );
         }
     }