From: Magnus Jacobsson Date: Sun, 22 Aug 2021 08:45:11 +0000 (+0200) Subject: ortho: use GVDLL instead of _WIN32 to enable storage-class attributes X-Git-Tag: 2.49.2~32^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=132f98c70cc987604027627594289d4458f90e2e;p=graphviz ortho: use GVDLL instead of _WIN32 to enable storage-class attributes 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 --- diff --git a/lib/ortho/ortho.h b/lib/ortho/ortho.h index 8909db070..4cf56cf5e 100644 --- a/lib/ortho/ortho.h +++ b/lib/ortho/ortho.h @@ -12,7 +12,7 @@ #include -#ifdef _WIN32 +#ifdef GVDLL #ifdef GVC_EXPORTS #define ORTHO_API __declspec(dllexport) #else