Show
Ignore:
Timestamp:
11/17/09 13:55:52 (4 years ago)
Author:
robert
Message:

Added OSG_CPP_EXCEPTIONS_AVAILABLE cmake option to enable optional build of plugins and examples that required C++ exceptions

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/png/ReaderWriterPNG.cpp

    r8578 r10763  
    5252void user_error_fn(png_structp png_ptr, png_const_charp error_msg) 
    5353{ 
     54#ifdef OSG_CPP_EXCEPTIONS_AVAILABLE 
    5455    throw PNGError(error_msg); 
     56#else 
     57    osg::notify(osg::WARN) << "PNG lib warning : " << error_msg << std::endl; 
     58#endif 
    5559} 
    5660 
     
    167171            png_set_error_fn(png, png_get_error_ptr(png), user_error_fn, user_warning_fn); 
    168172 
     173            #ifdef OSG_CPP_EXCEPTIONS_AVAILABLE 
    169174            try 
     175            #endif 
    170176            { 
    171  
    172177                info = png_create_info_struct(png); 
    173178                endinfo = png_create_info_struct(png); 
     
    301306 
    302307                return pOsgImage; 
    303             } 
     308 
     309            } 
     310            #ifdef OSG_CPP_EXCEPTIONS_AVAILABLE 
    304311            catch (PNGError& err) 
    305312            { 
     
    308315                return ReadResult::ERROR_IN_READING_FILE; 
    309316            } 
     317            #endif 
    310318        } 
    311319