]> granicus.if.org Git - graphviz/commitdiff
gvpack: use GVDLL instead of _WIN32 to enable dllimport storage-class attribute in...
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 3 Jan 2022 08:32:48 +0000 (09:32 +0100)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 12 Jan 2022 07:51:30 +0000 (08:51 +0100)
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

index 19106563a233dc9e86e22bee5487f8f25f2247a5..2197b8f78c55b930d07fc714b0d8b269c2c3e2f8 100644 (file)
 #include <stddef.h>
 #include <stdbool.h>
 
-#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 },