From bae41c847f084fe64b5920f09d7ffbac579c507a Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 28 Apr 2015 13:22:25 -0700 Subject: Promote SWAP to GPR_SWAP --- include/grpc/support/useful.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/grpc/support/useful.h b/include/grpc/support/useful.h index 979f3d026b..e1ce0455c6 100644 --- a/include/grpc/support/useful.h +++ b/include/grpc/support/useful.h @@ -45,4 +45,11 @@ #define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array))) +#define GPR_SWAP(type, a, b) \ + do { \ + type x = a; \ + a = b; \ + b = x; \ + } while (0) + #endif /* GRPC_SUPPORT_USEFUL_H */ -- cgit v1.2.3