From 70929f7e1616bab2783cc5735c6061981cda8a0f Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 10 May 2014 17:24:13 +0400 Subject: Add automatic generation of headers - The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception. --- src/nvim/os/event.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/os/event.c') diff --git a/src/nvim/os/event.c b/src/nvim/os/event.c index a89dcdc2ed..dd2b9ba0d1 100644 --- a/src/nvim/os/event.c +++ b/src/nvim/os/event.c @@ -20,11 +20,12 @@ #define _destroy_event(x) // do nothing KLIST_INIT(Event, Event, _destroy_event) +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "os/event.c.generated.h" +#endif static klist_t(Event) *event_queue; static uv_timer_t timer; static uv_prepare_t timer_prepare; -static void timer_cb(uv_timer_t *handle); -static void timer_prepare_cb(uv_prepare_t *); void event_init() { -- cgit From 7dd0d9d2ab401034516bd3bd344a71d819a88ef0 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 18 May 2014 00:57:46 +0400 Subject: Make nvim/lib/k*.h headers be the last one in the list So that they do the last nvim/func_attr.h include --- src/nvim/os/event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/os/event.c') diff --git a/src/nvim/os/event.c b/src/nvim/os/event.c index dd2b9ba0d1..cdf40541d5 100644 --- a/src/nvim/os/event.c +++ b/src/nvim/os/event.c @@ -4,7 +4,6 @@ #include -#include "nvim/lib/klist.h" #include "nvim/os/event.h" #include "nvim/os/input.h" #include "nvim/os/channel.h" @@ -16,6 +15,8 @@ #include "nvim/memory.h" #include "nvim/misc2.h" +#include "nvim/lib/klist.h" + // event will be cleaned up after it gets processed #define _destroy_event(x) // do nothing KLIST_INIT(Event, Event, _destroy_event) -- cgit