From b13bab469983492034ca968dd63b9253efef3a03 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 13 Aug 2020 20:11:39 -0700 Subject: [PATCH] remove #define EXTERN trick in cgraph This was designed to allow one declaration of Ag_G_global serve as both declaration and definition. However, this obscures the actual definition of this variable from any code browser unable to evaluate macro expansion (e.g. Cscope). There's no real need for this trick, as we can just define the variable as normal. --- lib/cgraph/cghdr.h | 6 +----- lib/cgraph/graph.c | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/cgraph/cghdr.h b/lib/cgraph/cghdr.h index db195d5db..131efbadf 100644 --- a/lib/cgraph/cghdr.h +++ b/lib/cgraph/cghdr.h @@ -15,10 +15,6 @@ #define ATT_GRAPHPVT_H 1 #define _BLD_cgraph 1 -#ifndef EXTERN -#define EXTERN extern -#endif - #ifdef _WIN32 # ifdef EXPORT_CGHDR # define CGHDR_API __declspec(dllexport) @@ -75,7 +71,7 @@ CGHDR_API int agapply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg, int preorder); /* global variables */ -EXTERN Agraph_t *Ag_G_global; +extern Agraph_t *Ag_G_global; extern char *AgDataRecName; /* set ordering disciplines */ diff --git a/lib/cgraph/graph.c b/lib/cgraph/graph.c index 453ac52c2..0d9dbac37 100644 --- a/lib/cgraph/graph.c +++ b/lib/cgraph/graph.c @@ -11,9 +11,10 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#define EXTERN #include +Agraph_t *Ag_G_global; + const char AgraphVersion[] = PACKAGE_VERSION; /* -- 2.40.0