From b3f6daf83d8adf0040a1bf9401342c811502f690 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Thu, 11 Dec 2014 18:58:04 -0800 Subject: Amalgamated distribution (upb.c/upb.h) tool. There are a number of tweaks to get this to work: - The #include dependence graph wasn't quite complete, and I had to add a few #includes to get the tool to work. - I had to change a number of symbol names to avoid conflicts between 'static' definitions in different .c files. This could be avoided if the tool were smart enough to rename static symbols to have unique prefixes instead, but (i) this requires semantic understanding of C, and (ii) the macro-defined static functions (e.g., handlers for primitive types in several places) would probably trip this up. Verified that the resulting upb.h/upb.c compiles and doesn't have any unresolved references. --- upb/json/printer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'upb/json/printer.c') diff --git a/upb/json/printer.c b/upb/json/printer.c index 28f3e4a..b996ccf 100644 --- a/upb/json/printer.c +++ b/upb/json/printer.c @@ -421,7 +421,7 @@ static size_t repeated_bytes(void *closure, const void *handler_data, return len; } -void sethandlers(const void *closure, upb_handlers *h) { +void printer_sethandlers(const void *closure, upb_handlers *h) { UPB_UNUSED(closure); upb_handlerattr empty_attr = UPB_HANDLERATTR_INITIALIZER; @@ -541,5 +541,5 @@ upb_sink *upb_json_printer_input(upb_json_printer *p) { const upb_handlers *upb_json_printer_newhandlers(const upb_msgdef *md, const void *owner) { - return upb_handlers_newfrozen(md, owner, sethandlers, NULL); + return upb_handlers_newfrozen(md, owner, printer_sethandlers, NULL); } -- cgit v1.2.3