Marty E. Plummer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46443 )
Change subject: helpers: add stringification macro ......................................................................
helpers: add stringification macro
Change-Id: I25216be4041c4d485e16e362e22a75089f57f271 Signed-off-by: Marty E. Plummer hanetzer@startmail.com --- M src/commonlib/bsd/include/commonlib/bsd/helpers.h 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/46443/1
diff --git a/src/commonlib/bsd/include/commonlib/bsd/helpers.h b/src/commonlib/bsd/include/commonlib/bsd/helpers.h index 4e6ebee..4e80d25 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/helpers.h +++ b/src/commonlib/bsd/include/commonlib/bsd/helpers.h @@ -8,6 +8,11 @@ #include <stddef.h> #endif
+#if !defined(STR) && !defined(XSTR) +#define STR(x) XSTR(x) +#define XSTR(x) #x +#endif + #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) #endif
Marty E. Plummer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46443 )
Change subject: helpers: add stringification macro ......................................................................
Patch Set 1:
I'm a bit unsure if this should go into bsd/helpers or just helpers; its not a particularly special bit of code, and its defined twice in coreboot atm, once in src/include/memlayout.ld and src/arch/riscv/include/bits.h under two different licenses.
Marty E. Plummer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46443 )
Change subject: helpers: add stringification macro ......................................................................
Patch Set 1:
In fact, it seems like the STR macro in riscv/bits.h is not used at all, and the definition in memlayout.h is just used in itself. can't see it used anywhere else, but I'm using it (as another local declaration for lack of a 'good' global location to get it from) in my current ppc64 work.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46443 )
Change subject: helpers: add stringification macro ......................................................................
Patch Set 1:
(1 comment)
I'm a bit unsure if this should go into bsd/helpers or just helpers; its not a particularly special bit of code, and its defined twice in coreboot atm, once in src/include/memlayout.ld and src/arch/riscv/include/bits.h under two different licenses.
Everything that can go into bsd/helpers should go there. The other helpers is just for stuff where I wasn't sure it was safe to relicense it to BSD. (For this macro, I think it's trivial enough that it shouldn't be copyrightable.)
https://review.coreboot.org/c/coreboot/+/46443/1/src/commonlib/bsd/include/c... File src/commonlib/bsd/include/commonlib/bsd/helpers.h:
https://review.coreboot.org/c/coreboot/+/46443/1/src/commonlib/bsd/include/c... PS1, Line 11: #if !defined(STR) && !defined(XSTR) Do we need this extra check? Just remove it from existing uses and have those include this file instead.
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/46443?usp=email )
Change subject: helpers: add stringification macro ......................................................................
Abandoned