mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Use unique var name in SAPI_RETURN_IF_ERROR to avoid name clashes
PiperOrigin-RevId: 350724380 Change-Id: I07c11b1897043df188bbef7934b5a41185a82a79
This commit is contained in:
parent
918a409126
commit
6dd0a52561
|
@ -25,12 +25,16 @@
|
||||||
#define SAPI_MACROS_IMPL_CONCAT_INNER_(x, y) x##y
|
#define SAPI_MACROS_IMPL_CONCAT_INNER_(x, y) x##y
|
||||||
#define SAPI_MACROS_IMPL_CONCAT(x, y) SAPI_MACROS_IMPL_CONCAT_INNER_(x, y)
|
#define SAPI_MACROS_IMPL_CONCAT(x, y) SAPI_MACROS_IMPL_CONCAT_INNER_(x, y)
|
||||||
|
|
||||||
#define SAPI_RETURN_IF_ERROR(expr) \
|
#define SAPI_RETURN_IF_ERROR(expr) \
|
||||||
do { \
|
SAPI_RETURN_IF_ERROR_IMPL(SAPI_MACROS_IMPL_CONCAT(_sapi_status, __LINE__), \
|
||||||
const auto status = (expr); \
|
expr)
|
||||||
if (ABSL_PREDICT_FALSE(!status.ok())) { \
|
|
||||||
return status; \
|
#define SAPI_RETURN_IF_ERROR_IMPL(status, expr) \
|
||||||
} \
|
do { \
|
||||||
|
const auto status = (expr); \
|
||||||
|
if (ABSL_PREDICT_FALSE(!status.ok())) { \
|
||||||
|
return status; \
|
||||||
|
} \
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
#define SAPI_ASSIGN_OR_RETURN(lhs, rexpr) \
|
#define SAPI_ASSIGN_OR_RETURN(lhs, rexpr) \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user