The immediate reason for this change is to enable Windows-specific
storage-class attributes for autotools builds with Cygwin. The _WIN32
symbol is not defined when using Cygwin.
Since https://gitlab.com/graphviz/graphviz/-/merge_requests/2182,
setting GVDLL is the preferred single mechanism to enable those
attributes, rather than using _WIN32 and __CYGWIN__ plus some other
symbol to distinguish between static and dynamic-link/shared
libraries.
This is the first step of two in fixing these errors in autotools
builds with Cygwin:
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/dotgen/.libs/libdotgen_C.a(dotsplines.o): in function `_dot_splines':
/home/magja/graphviz/lib/dotgen/dotsplines.c:334: undefined reference to `orthoEdges'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /home/magja/graphviz/lib/dotgen/dotsplines.c:337: undefined reference to `orthoEdges'
The Windows-specific storage-class attributes are however still not
correct for Cygwin autotools builds, since GVC_EXPORT is currently not
set in the autotools builds. The error is now instead:
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/dotgen/.libs/libdotgen_C.a(dotsplines.o): in function `_dot_splines':
/home/magja/graphviz/lib/dotgen/dotsplines.c:334: undefined reference to `__imp_orthoEdges'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /home/magja/graphviz/lib/dotgen/dotsplines.c:337: undefined reference to `__imp_orthoEdges'
The next commit in this series will fix this.
Also towards
https://gitlab.com/graphviz/graphviz/-/issues/2058#note_678679545
#include <render.h>
-#ifdef _WIN32
+#ifdef GVDLL
#ifdef GVC_EXPORTS
#define ORTHO_API __declspec(dllexport)
#else