From: Magnus Jacobsson Date: Sat, 18 Dec 2021 07:25:59 +0000 (+0100) Subject: sparse: correct storage-class declaration of Verbose when STANDALONE X-Git-Tag: 3.0.0~118^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f39e0010a42455f645661b7199fd6f11afcffe9;p=graphviz sparse: correct storage-class declaration of Verbose when STANDALONE An upcoming commit that removes the common/globals.h symbols from the gvc.def file would otherwise cause errors like this: sparse.lib(mq.obj) : error LNK2001: unresolved external symbol _Verbose [C:\Users\magja\graphviz\cmd\gvmap\gvmap.vcxproj] This is for the STANDALONE case when Verbose is defined by the application that uses lib/sparse rather than using the definition in lib/common/globals.h. In this case, Verbose is not exported from any library. From lib/sparse/general.h: /* Applications that do not use the common library can define STANDALONE * to get definitions/definitions that are normally provided there. * In particular, note that Verbose is declared but undefined. */ Towards https://gitlab.com/graphviz/graphviz/-/issues/2058. --- diff --git a/lib/sparse/general.h b/lib/sparse/general.h index 4828d5ef6..bf0ea12d1 100644 --- a/lib/sparse/general.h +++ b/lib/sparse/general.h @@ -56,7 +56,11 @@ #define POINTS(inch) 72*(inch) typedef unsigned int boolean; +#ifdef GVDLL +__declspec(dllimport) extern unsigned char Verbose; +#else extern unsigned char Verbose; +#endif #else /* STANDALONE */ #define CALLOC gcalloc