diff options
-rw-r--r-- | lldb/include/lldb/Core/Error.h | 6 | ||||
-rw-r--r-- | lldb/source/Core/Error.cpp | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lldb/include/lldb/Core/Error.h b/lldb/include/lldb/Core/Error.h index d4b8bab2383..adaf5dbb244 100644 --- a/lldb/include/lldb/Core/Error.h +++ b/lldb/include/lldb/Core/Error.h @@ -11,7 +11,9 @@ #define __DCError_h__ #if defined(__cplusplus) +#ifdef __APPLE__ #include <mach/mach.h> +#endif #include <stdint.h> #include <stdio.h> #include <string> @@ -90,7 +92,7 @@ public: /// A const reference to this object. //------------------------------------------------------------------ const Error& - operator = (kern_return_t err); + operator = (uint32_t err); ~Error(); @@ -200,7 +202,7 @@ public: /// A mach error code. //------------------------------------------------------------------ void - SetError (kern_return_t err); + SetError (uint32_t err); //------------------------------------------------------------------ /// Set accesssor with an error value and type. diff --git a/lldb/source/Core/Error.cpp b/lldb/source/Core/Error.cpp index c3522093f9b..24ab2fc6f98 100644 --- a/lldb/source/Core/Error.cpp +++ b/lldb/source/Core/Error.cpp @@ -15,6 +15,9 @@ // Project includes #include "lldb/Core/Error.h" #include "lldb/Core/Log.h" +#include <cstdarg> +#include <cstdlib> +#include <cstring> #if defined (__arm__) #include <SpringBoardServices/SpringBoardServer.h> @@ -52,7 +55,7 @@ Error::operator = (const Error& rhs) // Assignment operator //---------------------------------------------------------------------- const Error& -Error::operator = (kern_return_t err) +Error::operator = (uint32_t err) { m_code = err; m_type = eErrorTypeMachKernel; @@ -81,7 +84,9 @@ Error::AsCString(const char *default_error_str) const switch (m_type) { case eErrorTypeMachKernel: +#ifdef __APPLE__ s = ::mach_error_string (m_code); +#endif break; case eErrorTypePOSIX: @@ -223,7 +228,7 @@ Error::LogIfError (Log *log, const char *format, ...) // "eErrorTypeMachKernel" //---------------------------------------------------------------------- void -Error::SetError (kern_return_t err) +Error::SetError (uint32_t err) { m_code = err; m_type = eErrorTypeMachKernel; |