Only set __declspec(dllexport) or __declspec(dllimport) when the gvpr
library is dynamically linked. This is defined by GVDLL which is set
in the Windows MSBuild builds which use dynamic linking, but unset in
the Windows CMake builds which use static linking.
Removes the following warning from the Windows CMake builds:
C:\GitLab-Runner\builds\graphviz\graphviz\lib\gvpr\gvpr.c(931,1): warning C4273: 'gvpr': inconsistent dll linkage [C:\GitLab-Runner\builds\graphviz\graphviz\build\lib\gvpr\gvpr.vcxproj]
#define GVPR_H
#ifdef _WIN32
-# ifdef EXPORT_GVPR
-# define GVPR_API __declspec(dllexport)
-# else
-# define GVPR_API __declspec(dllimport)
+# ifdef GVDLL
+# ifdef EXPORT_GVPR
+# define GVPR_API __declspec(dllexport)
+# else
+# define GVPR_API __declspec(dllimport)
+# endif
# endif
-#else
-# define GVPR_API extern
+#endif
+
+#ifndef GVPR_API
+# define GVPR_API /* nothing */
#endif
#include "cgraph.h"
gvprbinding* bindings; /* array of bindings, terminated with {NULL,NULL} */
} gvpropts;
-GVPR_API int gvpr (int argc, char *argv[], gvpropts* opts);
+GVPR_API extern int gvpr (int argc, char *argv[], gvpropts* opts);
#endif