00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef ACE_OS_NS_ERRNO_H
00018 # define ACE_OS_NS_ERRNO_H
00019
00020 # include "ace/pre.h"
00021
00022 # include "ace/config-lite.h"
00023
00024 # if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 # endif
00027
00028 #include "ace/os_include/os_errno.h"
00029 #include "ace/ACE_export.h"
00030
00031 #if defined (ACE_EXPORT_MACRO)
00032 # undef ACE_EXPORT_MACRO
00033 #endif
00034 #define ACE_EXPORT_MACRO ACE_Export
00035
00036 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00037
00038 namespace ACE_OS {
00039
00040 ACE_NAMESPACE_INLINE_FUNCTION
00041 int last_error (void);
00042
00043 ACE_NAMESPACE_INLINE_FUNCTION
00044 void last_error (int);
00045
00046 ACE_NAMESPACE_INLINE_FUNCTION
00047 int set_errno_to_last_error (void);
00048
00049 ACE_NAMESPACE_INLINE_FUNCTION
00050 int set_errno_to_wsa_last_error (void);
00051
00052 }
00053
00054 #if defined (ACE_HAS_WINCE_BROKEN_ERRNO)
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 class ACE_Export ACE_CE_Errno
00065 {
00066 public:
00067 ACE_CE_Errno () {}
00068 static void init ();
00069 static void fini ();
00070 static ACE_CE_Errno *instance ();
00071
00072 operator int (void) const;
00073 int operator= (int);
00074
00075 private:
00076 static ACE_CE_Errno *instance_;
00077 static DWORD errno_key_;
00078 };
00079
00080 # define errno (* (ACE_CE_Errno::instance ()))
00081 #endif
00082
00083 #if defined (ACE_HAS_WINCE_BROKEN_ERRNO)
00084 # define ACE_ERRNO_TYPE ACE_CE_Errno
00085 #else
00086 # define ACE_ERRNO_TYPE int
00087 #endif
00088
00089 ACE_END_VERSIONED_NAMESPACE_DECL
00090
00091 # if defined (ACE_HAS_INLINED_OSCALLS)
00092 # if defined (ACE_INLINE)
00093 # undef ACE_INLINE
00094 # endif
00095 # define ACE_INLINE inline
00096 # include "ace/OS_NS_errno.inl"
00097 # endif
00098
00099 # include "ace/post.h"
00100 #endif