[PATCH] preprocess: use predefine() also for __%s__TYPE__

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 lib.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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)
-- 
2.27.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux