Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:47

0001 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
0002 
0003 //Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_EXCEPTION_F0EE17BE6C1211DE87FF459155D89593
0007 #define BOOST_EXCEPTION_F0EE17BE6C1211DE87FF459155D89593
0008 
0009 #include <boost/exception/info.hpp>
0010 #include <errno.h>
0011 #include <string.h>
0012 
0013 #ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
0014 #if __GNUC__*100+__GNUC_MINOR__>301
0015 #pragma GCC system_header
0016 #endif
0017 #ifdef __clang__
0018 #pragma clang system_header
0019 #endif
0020 #ifdef _MSC_VER
0021 #pragma warning(push,1)
0022 #pragma warning(disable:4996)
0023 #endif
0024 #endif
0025 
0026 namespace
0027 boost
0028     {
0029     typedef error_info<struct errinfo_errno_,int> errinfo_errno;
0030 
0031     //Usage hint:
0032     //if( c_function(....)!=0 )
0033     //    BOOST_THROW_EXCEPTION(
0034     //        failure() <<
0035     //        errinfo_errno(errno) <<
0036     //        errinfo_api_function("c_function") );
0037     inline
0038     std::string
0039     to_string( errinfo_errno const & e )
0040         {
0041         std::ostringstream tmp;
0042         int v=e.value();
0043         tmp  << '[' << error_info_name(e) << "] = " << v << ", \"" << strerror(v) << "\"\n";
0044         return tmp.str();
0045         }
0046     }
0047 
0048 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
0049 #pragma warning(pop)
0050 #endif
0051 #endif