mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-12 19:04:59 +00:00
move stringify macro to common include
We need to stringify macros arguments in various places in the code, avoid duplicating this definition. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=make buildall Change-Id: I03530c06139fad4c60711d041239b396d9ed321e Reviewed-on: https://chromium-review.googlesource.com/201576 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
8c89bcff4d
commit
56e0e67abe
@@ -27,6 +27,15 @@
|
||||
#define CONCAT3(w, x, y) CONCAT_STAGE_1(w, x, y, )
|
||||
#define CONCAT4(w, x, y, z) CONCAT_STAGE_1(w, x, y, z)
|
||||
|
||||
/*
|
||||
* Macros to turn the argument into a string constant.
|
||||
*
|
||||
* Compared to directly using the preprocessor # operator, this 2-stage macro
|
||||
* is safe with regards to using nested macros and defined arguments.
|
||||
*/
|
||||
#define STRINGIFY0(name) #name
|
||||
#define STRINGIFY(name) STRINGIFY0(name)
|
||||
|
||||
/* Macros to access registers */
|
||||
#define REG32(addr) (*(volatile uint32_t *)(addr))
|
||||
#define REG16(addr) (*(volatile uint16_t *)(addr))
|
||||
|
||||
Reference in New Issue
Block a user