diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:53:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:53:01 +0000 |
commit | ead246455adf1a215ec2715dad6533073a6beb4e (patch) | |
tree | f3f97a47d77053bf96fe74cdbd6fae74380e8a92 /include/lldb/Utility/Status.h | |
parent | fdb00c4408990a0a63ef7f496d809ce59f263bc5 (diff) |
Notes
Diffstat (limited to 'include/lldb/Utility/Status.h')
-rw-r--r-- | include/lldb/Utility/Status.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/include/lldb/Utility/Status.h b/include/lldb/Utility/Status.h index ae730b90dffe..e6a0a8e7fce1 100644 --- a/include/lldb/Utility/Status.h +++ b/include/lldb/Utility/Status.h @@ -47,8 +47,8 @@ public: /// into ValueType. typedef uint32_t ValueType; - /// Default constructor. - /// + Status(); + /// Initialize the error object with a generic success value. /// /// \param[in] err @@ -56,23 +56,14 @@ public: /// /// \param[in] type /// The type for \a err. - Status(); - explicit Status(ValueType err, lldb::ErrorType type = lldb::eErrorTypeGeneric); - /* implicit */ Status(std::error_code EC); + Status(std::error_code EC); explicit Status(const char *format, ...) __attribute__((format(printf, 2, 3))); - /// Assignment operator. - /// - /// \param[in] err - /// An error code. - /// - /// \return - /// A const reference to this object. const Status &operator=(const Status &rhs); ~Status(); @@ -221,4 +212,11 @@ template <> struct format_provider<lldb_private::Status> { }; } +#define LLDB_ERRORF(status, fmt, ...) \ + do { \ + if (status) { \ + (status)->SetErrorStringWithFormat((fmt), __VA_ARGS__); \ + } \ + } while (0); + #endif // #ifndef LLDB_UTILITY_STATUS_H |