Silicium
get_last_error.hpp
Go to the documentation of this file.
1 #ifndef SILICIUM_GET_LAST_ERROR_HPP
2 #define SILICIUM_GET_LAST_ERROR_HPP
3 
4 #include <silicium/config.hpp>
5 #include <boost/system/error_code.hpp>
6 
7 #ifdef _WIN32
8 # include <silicium/win32/win32.hpp>
9 #else
10 # include <errno.h>
11 #endif
12 
13 namespace Si
14 {
16  inline boost::system::error_code get_last_error()
17  {
18  auto const err =
19 #ifdef _WIN32
20  ::GetLastError();
21 #else
22  errno;
23 #endif
24  return boost::system::error_code(err, boost::system::system_category());
25  }
26 }
27 
28 #endif
Definition: absolute_path.hpp:19
SILICIUM_USE_RESULT boost::system::error_code get_last_error()
Definition: get_last_error.hpp:16
#define SILICIUM_USE_RESULT
Definition: config.hpp:147