commit 8108e0ad88837106d9da9a43088ae8bb40050bdd
parent 095a47078b742ef96e210dc7d472e7ebbc4ee26d
Author: vaplv <vaplv@free.fr>
Date: Sat, 12 Oct 2013 15:17:50 +0200
Add the SWAP helper macro
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/rsys.h b/src/rsys.h
@@ -132,6 +132,13 @@
(Id) > CONCAT(end__, __LINE__); \
--(Id))
+#define SWAP(Type, A, B) \
+ { \
+ Type tmp__ = (A); \
+ (A) = (B); \
+ (B) = tmp__; \
+ } (void)0
+
#define IS_MEMORY_OVERLAPPED(D0, Sz0, D1, Sz1) \
(((intptr_t)(D0) >= (intptr_t)(D1) && \
(intptr_t)(D0) < ((intptr_t)(D1) + (intptr_t)(Sz1))) || \