]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/exception/errinfo_errno.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
c1e6c97dc3d72191f17401ed3daa2c3847ab249c
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / exception / errinfo_errno.hpp
1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
2 \r
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying\r
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
5 \r
6 #ifndef UUID_F0EE17BE6C1211DE87FF459155D89593\r
7 #define UUID_F0EE17BE6C1211DE87FF459155D89593\r
8 #if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)\r
9 #pragma GCC system_header\r
10 #endif\r
11 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)\r
12 #pragma warning(push,1)\r
13 #endif\r
14 \r
15 #include "boost/exception/info.hpp"\r
16 #include <errno.h>\r
17 #include <string.h>\r
18 \r
19 namespace\r
20 boost\r
21     {\r
22     typedef error_info<struct errinfo_errno_,int> errinfo_errno;\r
23 \r
24     //Usage hint:\r
25     //if( c_function(....)!=0 )\r
26     //    BOOST_THROW_EXCEPTION(\r
27     //        failure() <<\r
28     //        errinfo_errno(errno) <<\r
29     //        errinfo_api_function("c_function") );\r
30     inline\r
31     std::string\r
32     to_string( errinfo_errno const & e )\r
33         {\r
34         std::ostringstream tmp;\r
35         int v=e.value();\r
36         tmp << v << ", \"" << strerror(v) << "\"";\r
37         return tmp.str();\r
38         }\r
39     }\r
40 \r
41 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)\r
42 #pragma warning(pop)\r
43 #endif\r
44 #endif\r