From 00370bc8885faec1da094db463b928800d3e7767 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Mon, 3 Jan 2022 09:32:48 +0100 Subject: [PATCH] gvpack: use GVDLL instead of _WIN32 to enable dllimport storage-class attribute in gvpack.c Fixes these errors when building statically with MinGW: C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gvpack_static-gvpack.o: in function `main': C:\Users\magja\graphviz\cmd\tools/gvpack.c:857: undefined reference to `__imp_gvplugin_neato_layout_LTX_library' collect2.exe: error: ld returned 1 exit status C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gvpack-gvpack.o: in function `main': C:\Users\magja\graphviz\cmd\tools/gvpack.c:857: undefined reference to `__imp_gvplugin_neato_layout_LTX_library' Fixes https://gitlab.com/graphviz/graphviz/-/issues/2173. --- cmd/tools/gvpack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tools/gvpack.c b/cmd/tools/gvpack.c index 19106563a..2197b8f78 100644 --- a/cmd/tools/gvpack.c +++ b/cmd/tools/gvpack.c @@ -28,13 +28,13 @@ #include #include -#if defined(_WIN32) +#ifdef GVDLL __declspec(dllimport) #endif extern gvplugin_library_t gvplugin_neato_layout_LTX_library; lt_symlist_t lt_preloaded_symbols[] = { -#if defined(_WIN32) +#ifdef GVDLL { "gvplugin_neato_layout_LTX_library", 0 }, #else { "gvplugin_neato_layout_LTX_library", &gvplugin_neato_layout_LTX_library }, -- 2.40.0