Use unique var name in SAPI_RETURN_IF_ERROR to avoid name clashes

PiperOrigin-RevId: 350724380
Change-Id: I07c11b1897043df188bbef7934b5a41185a82a79
This commit is contained in:
Wiktor Garbacz 2021-01-08 02:09:09 -08:00 committed by Copybara-Service
parent 918a409126
commit 6dd0a52561

View File

@ -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) \