From: Roland Lutz Date: Fri, 4 Sep 2020 11:41:19 +0000 (+0200) Subject: gschem: Define action variables only once X-Git-Tag: 1.10.1-20201216~35 X-Git-Url: https://repo.or.cz/geda-gaf.git/commitdiff_plain/20aec04f904a89d251b9a1f9faf5c53a002a00f8 gschem: Define action variables only once Reported-by: Glen W. Ruch --- diff --git a/gschem/src/actions.decl.h b/gschem/src/actions.decl.h index 6595153ea..fc3cfefcd 100644 --- a/gschem/src/actions.decl.h +++ b/gschem/src/actions.decl.h @@ -25,9 +25,9 @@ * variable declarations for the individual actions defined in * actions.c. The resulting file looks like this: * - * GschemAction *action_file_new; - * GschemAction *action_file_new_window; - * GschemAction *action_file_open; + * extern GschemAction *action_file_new; + * extern GschemAction *action_file_new_window; + * extern GschemAction *action_file_open; * ... * * Source files which reference individual actions by name (e.g. in @@ -39,6 +39,6 @@ */ #define DEFINE_ACTION(c_id, id, icon, name, label, menu_label, tooltip, type) \ - KEEP_LINE GschemAction *action_ ## c_id; + KEEP_LINE extern GschemAction *action_ ## c_id; #include "actions.c" #undef DEFINE_ACTION diff --git a/gschem/src/gschem_action.c b/gschem/src/gschem_action.c index 2def3ad2a..d423cbac8 100644 --- a/gschem/src/gschem_action.c +++ b/gschem/src/gschem_action.c @@ -65,6 +65,7 @@ #include "gschem.h" #define DEFINE_ACTION(c_id, id, icon, name, label, menu_label, tooltip, type) \ + GschemAction *action_ ## c_id; \ static void action_callback_ ## c_id (GschemAction *action, \ GschemToplevel *w_current) #include "actions.c"