From 9f39e0010a42455f645661b7199fd6f11afcffe9 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sat, 18 Dec 2021 08:25:59 +0100 Subject: [PATCH] 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. --- lib/sparse/general.h | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.50.1