From d269dfc64fb5307dbbaecbc5d55861a705b729ab Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 22 Jun 2017 10:23:30 +0100 Subject: Add STRINGIFY to gdb/common/preprocessor.h We have several copies of this common idiom under gdb/ currently. This commit moves them / factors them out to gdb/common/preprocessor.h. gdb/ChangeLog: 2017-06-22 Pedro Alves * common/agent.h: Include "common/preprocessor.h". (STRINGIZE_1, STRINGIZE): Delete. (IPA_SYM): Use STRINGIFY instead. * common/preprocessor.h (STRINGIFY_1, STRINGIFY): New. * compile/compile-c-support.c: Include "common/preprocessor.h". (STR, STRINGIFY): Delete. * ia64-libunwind-tdep.c: Include "common/preprocessor.h". (STRINGIFY2, STRINGIFY): Delete. --- gdb/common/preprocessor.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/common/preprocessor.h') diff --git a/gdb/common/preprocessor.h b/gdb/common/preprocessor.h index 6877344..3543a90 100644 --- a/gdb/common/preprocessor.h +++ b/gdb/common/preprocessor.h @@ -24,6 +24,10 @@ #define CONCAT_1(a, b) a ## b #define CONCAT(a, b) CONCAT_1 (a, b) +/* Stringification. */ +#define STRINGIFY_1(x) #x +#define STRINGIFY(x) STRINGIFY_1 (x) + /* Escape parens out. Useful if you need to pass an argument that includes commas to another macro. */ #define ESC(...) __VA_ARGS__ -- cgit v1.1