Android-cuttlefish cvd tool
Classes | Namespaces | Macros | Functions
errors.h File Reference
#include <assert.h>
#include <string>
Include dependency graph for errors.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  android::base::OkOrFail< T, typename >
 

Namespaces

namespace  android
 
namespace  android::base
 

Macros

#define OR_RETURN(expr)
 
#define OR_FATAL(expr)
 

Functions

std::string android::base::SystemErrorCodeToString (int error_code)
 

Macro Definition Documentation

◆ OR_FATAL

#define OR_FATAL (   expr)
Value:
({ \
decltype(expr)&& __or_fatal_expr = (expr); \
typedef android::base::OkOrFail<std::remove_reference_t<decltype(__or_fatal_expr)>> \
ok_or_fail; \
if (!ok_or_fail::IsOk(__or_fatal_expr)) { \
fprintf(stderr, "%s:%d: assertion \"%s\" failed", __FILE__, __LINE__, \
ok_or_fail::ErrorMessage(__or_fatal_expr).c_str()); \
abort(); \
} \
ok_or_fail::Unwrap(std::move(__or_fatal_expr)); \
})
Definition: errors.h:119

◆ OR_RETURN

#define OR_RETURN (   expr)
Value:
({ \
decltype(expr)&& __or_return_expr = (expr); \
typedef android::base::OkOrFail<std::remove_reference_t<decltype(__or_return_expr)>> \
ok_or_fail; \
if (!ok_or_fail::IsOk(__or_return_expr)) { \
return ok_or_fail::Fail(std::move(__or_return_expr)); \
} \
ok_or_fail::Unwrap(std::move(__or_return_expr)); \
})