Message ID | 20200629192047.92114-1-luc.vanoostenryck@gmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | preprocess: use predefine() also for __%s__TYPE__ | expand |
diff --git a/lib.c b/lib.c index e56788260cb7..d8fbe8b1a006 100644 --- a/lib.c +++ b/lib.c @@ -1274,7 +1274,10 @@ static void predefined_min(const char *name, struct symbol *type) static void predefined_type(const char *name, struct symbol *type) { const char *typename = builtin_typename(type); - add_pre_buffer("#weak_define __%s_TYPE__ %s\n", name, typename); + char buf[32]; + + snprintf(buf, sizeof(buf), "__%s_TYPE__", name); + predefine(buf, 1, typename); } static void predefined_ctype(const char *name, struct symbol *type, int flags)
Most predefined macros are created by predefine() which avoid the 'write then parse' done with add_pre_buffer() but those defined by predefined_type() did not. So, convert predefine_type() to use predefine(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- lib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)