Imported Upstream version 1.57.0
[platform/upstream/boost.git] / boost / interprocess / errors.hpp
index 9eed55a..6d4572f 100644 (file)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
 // Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //
@@ -24,7 +24,7 @@
 #ifndef BOOST_INTERPROCESS_ERRORS_HPP
 #define BOOST_INTERPROCESS_ERRORS_HPP
 
-#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+#if defined(_MSC_VER)
 #  pragma once
 #endif
 
@@ -33,7 +33,7 @@
 #include <stdarg.h>
 #include <string>
 
-#if (defined BOOST_INTERPROCESS_WINDOWS)
+#if defined (BOOST_INTERPROCESS_WINDOWS)
 #  include <boost/interprocess/detail/win32_api.hpp>
 #else
 #  ifdef BOOST_HAS_UNISTD_H
 #  else  //ifdef BOOST_HAS_UNISTD_H
 #    error Unknown platform
 #  endif //ifdef BOOST_HAS_UNISTD_H
-#endif   //#if (defined BOOST_INTERPROCESS_WINDOWS)
+#endif   //#if defined (BOOST_INTERPROCESS_WINDOWS)
 
 //!\file
 //!Describes the error numbering of interprocess classes
 
 namespace boost {
 namespace interprocess {
-/// @cond
+#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
 inline int system_error_code() // artifact of POSIX and WINDOWS error reporting
 {
-   #if (defined BOOST_INTERPROCESS_WINDOWS)
+   #if defined (BOOST_INTERPROCESS_WINDOWS)
    return winapi::get_last_error();
    #else
    return errno; // GCC 3.1 won't accept ::errno
@@ -60,7 +60,7 @@ inline int system_error_code() // artifact of POSIX and WINDOWS error reporting
 }
 
 
-#if (defined BOOST_INTERPROCESS_WINDOWS)
+#if defined (BOOST_INTERPROCESS_WINDOWS)
 inline void fill_system_message(int sys_err_code, std::string &str)
 {
    void *lpMsgBuf;
@@ -85,7 +85,7 @@ inline void fill_system_message(int sys_err_code, std::string &str)
 inline void fill_system_message( int system_error, std::string &str)
 {  str = std::strerror(system_error);  }
 # endif
-/// @endcond
+#endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
 
 enum error_code_t
 {
@@ -115,11 +115,12 @@ enum error_code_t
    invalid_argument,
    timeout_when_locking_error,
    timeout_when_waiting_error,
+   owner_dead_error
 };
 
 typedef int    native_error_t;
 
-/// @cond
+#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
 struct ec_xlate
 {
    native_error_t sys_ec;
@@ -128,7 +129,7 @@ struct ec_xlate
 
 static const ec_xlate ec_table[] =
 {
-   #if (defined BOOST_INTERPROCESS_WINDOWS)
+   #if defined (BOOST_INTERPROCESS_WINDOWS)
    { /*ERROR_ACCESS_DENIED*/5L, security_error },
    { /*ERROR_INVALID_ACCESS*/12L, security_error },
    { /*ERROR_SHARING_VIOLATION*/32L, security_error },
@@ -161,7 +162,7 @@ static const ec_xlate ec_table[] =
    { /*ERROR_NOT_ENOUGH_MEMORY*/8L, out_of_memory_error },
    { /*ERROR_TOO_MANY_OPEN_FILES*/4L, out_of_resource_error },
    { /*ERROR_INVALID_ADDRESS*/487L, busy_error }
-   #else    //#if (defined BOOST_INTERPROCESS_WINDOWS)
+   #else    //#if defined (BOOST_INTERPROCESS_WINDOWS)
    { EACCES, security_error },
    { EROFS, read_only_error },
    { EIO, io_error },
@@ -179,11 +180,11 @@ static const ec_xlate ec_table[] =
    { EMFILE, out_of_resource_error },
    { ENOENT, not_such_file_or_directory },
    { EINVAL, invalid_argument }
-   #endif   //#if (defined BOOST_INTERPROCESS_WINDOWS)
+   #endif   //#if defined (BOOST_INTERPROCESS_WINDOWS)
 };
 
 inline error_code_t lookup_error(native_error_t err)
-{ 
+{
    const ec_xlate *cur  = &ec_table[0],
                   *end  = cur + sizeof(ec_table)/sizeof(ec_xlate);
    for  (;cur != end; ++cur ){
@@ -226,7 +227,7 @@ struct error_info
    native_error_t m_nat;
    error_code_t   m_ec;
 };
-/// @endcond
+#endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
 
 }  // namespace interprocess {
 }  // namespace boost