include/tc_util.h: Rename __str to fix C++ compile error

Several C++ std library headers use __str as internal
variable names. If those headers are included after
tc_util.h is included those headers fail to compile
because tc_util.h defined __str to be a macro.

Fixed by renaming the __str macro to TC_STR.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
This commit is contained in:
Erwin Rol 2019-09-28 14:32:15 +02:00 committed by Kumar Gala
commit 1af66a9cc5

View file

@ -42,10 +42,10 @@
*
* TC_RUNID is any string, that will be converted to a string literal.
*/
#define __str(x) #x
#define _str(x) __str(x)
#define TC_STR_HELPER(x) #x
#define TC_STR(x) TC_STR_HELPER(x)
#ifdef TC_RUNID
#define TC_PRINT_RUNID PRINT_DATA("RunID: " _str(TC_RUNID) "\n")
#define TC_PRINT_RUNID PRINT_DATA("RunID: " TC_STR(TC_RUNID) "\n")
#else
#define TC_PRINT_RUNID do {} while (0)
#endif