]> granicus.if.org Git - graphviz/commitdiff
sparse: correct storage-class declaration of Verbose when STANDALONE
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 18 Dec 2021 07:25:59 +0000 (08:25 +0100)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 19 Dec 2021 21:41:19 +0000 (22:41 +0100)
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

index 4828d5ef634374b096d6a1801376893462124eed..bf0ea12d1646ba047d5c58d43f441ec0da397dd8 100644 (file)
 #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