Add SWAP util macro

This commit is contained in:
Orestis Floros 2017-09-16 13:43:28 +03:00
parent 8cad1c1fa6
commit 71e309597c
1 changed files with 7 additions and 0 deletions

View File

@ -57,6 +57,13 @@
#define CALL(obj, member, ...) obj->member(obj, ##__VA_ARGS__)
#define SWAP(first, second, type) \
do { \
type tmp_SWAP = first; \
first = second; \
second = tmp_SWAP; \
} while (0)
int min(int a, int b);
int max(int a, int b);
bool rect_contains(Rect rect, uint32_t x, uint32_t y);