Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
4089d7c
)
vppinfra: add CLIB_SWAP()
01/41601/2
author
Damjan Marion
<damarion@cisco.com>
Wed, 25 Sep 2024 13:52:16 +0000
(15:52 +0200)
committer
Florin Coras
<florin.coras@gmail.com>
Wed, 25 Sep 2024 20:05:45 +0000
(20:05 +0000)
Type: improvement
Change-Id: I1911a9d6a0ca8e1d24ce7b95281886392081ffc6
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/vppinfra/clib.h
patch
|
blob
|
history
diff --git
a/src/vppinfra/clib.h
b/src/vppinfra/clib.h
index
75cebc6
..
5348738
100644
(file)
--- a/
src/vppinfra/clib.h
+++ b/
src/vppinfra/clib.h
@@
-106,6
+106,13
@@
#define CLIB_STRING_ARRAY(...) \
(char *[]) { __VA_ARGS__, 0 }
+#define CLIB_SWAP(a, b) \
+ { \
+ typeof (a) __tmp = a; \
+ a = b; \
+ b = __tmp; \
+ }
+
/* sanitizers */
#ifdef __has_feature
#if __has_feature(address_sanitizer)