Magnus Jacobsson [Tue, 28 Sep 2021 18:33:21 +0000 (20:33 +0200)]
pathplan: autotools: add define of PATHPLAN_EXPORTS
Fixes errors like this using autotools with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/cvt.o: in function `Pobsopen':
C:\Users\magja\graphviz\lib\pathplan/cvt.c:80: undefined reference to `__imp_visibility'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2058
Magnus Jacobsson [Mon, 27 Sep 2021 21:05:27 +0000 (23:05 +0200)]
common: autotools: define also GVC_EXPORTS
Fixes errors like this using autotools with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/common/.libs/libcommon_C.a(arrows.o): in function `arrow_type_curve':
C:\Users\magja\graphviz\lib\common/arrows.c:696: undefined reference to `__imp_Bezier'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2058
Magnus Jacobsson [Sat, 31 Jul 2021 10:39:00 +0000 (12:39 +0200)]
label: autotools: define GVC_EXPORTS
Fixes this error using autotools with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/label/.libs/liblabel_C.a(xlabels.o): in function `xlnew':
C:\Users\magja\graphviz\lib\label/xlabels.c:41: undefined reference to `__imp_zmalloc'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2058
Magnus Jacobsson [Thu, 22 Jul 2021 13:58:41 +0000 (15:58 +0200)]
pack: autotools: define GVC_EXPORTS
Fixes errors like this using autotools with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/pack/.libs/libpack_C.a(pack.o): in function `fillLine':
C:\Users\magja\graphviz\lib\pack/pack.c:127: undefined reference to `__imp_addPS'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2058
The gvc source files do not refer to xdot explicitly and any implicit
references are now resolved by the transitive dependency through
common.
Fixes these errors using autotools with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/xdot/.libs/libxdot.dll.a(d000007.o):(.text+0x0): multiple definition of `parseXDotF'; ../../lib/xdot/.libs/libxdot_C.a(xdot.o):C:\Users\magja\graphviz\lib\xdot/xdot.c:475: first defined here
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/xdot/.libs/libxdot.dll.a(d000002.o):(.text+0x0): multiple definition of `freeXDot'; ../../lib/xdot/.libs/libxdot_C.a(xdot.o):C:\Users\magja\graphviz\lib\xdot/xdot.c:927: first defined here
Magnus Jacobsson [Tue, 28 Sep 2021 19:09:47 +0000 (21:09 +0200)]
common: autotools: add linking to xdot
E.g. lib/common/emit.c. uses parseXDotF from lib/xdot/xdot.c.
This removes the need to link to xdot for downstream libraries that do
not explicitly use xdot.
Fixes these errors using autotools with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/common/.libs/libcommon_C.a(input.o): in function `graph_cleanup':
C:\Users\magja\graphviz\lib\common/input.c:881: undefined reference to `__imp_freeXDot'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/common/.libs/libcommon_C.a(emit.o): in function `init_xdot':
C:\Users\magja\graphviz\lib\common/emit.c:58: undefined reference to `__imp_parseXDotF'
Magnus Jacobsson [Wed, 29 Sep 2021 19:06:59 +0000 (21:06 +0200)]
lib: autotools: build xdot before common
E.g. lib/common/emit.c. uses parseXDotF from lib/xdot/xdot.c.
This is the first step in fixing these errors using autotools with
MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/common/.libs/libcommon_C.a(input.o): in function `graph_cleanup':
C:\Users\magja\graphviz\lib\common/input.c:881: undefined reference to `__imp_freeXDot'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../lib/common/.libs/libcommon_C.a(emit.o): in function `init_xdot':
C:\Users\magja\graphviz\lib\common/emit.c:58: undefined reference to `__imp_parseXDotF'
The next commit in this series will add linking to xdot.
Magnus Jacobsson [Thu, 22 Jul 2021 13:59:29 +0000 (15:59 +0200)]
pathplan: autotools: use pathplan.def
Fixes these errors when using autotools with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/cvt.o: in function `Pobsopen':
C:\Users\magja\graphviz\lib\pathplan/cvt.c:80: undefined reference to `__imp_visibility'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/cvt.o: in function `Pobspath':
C:\Users\magja\graphviz\lib\pathplan/cvt.c:108: undefined reference to `__imp_ptVis'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\magja\graphviz\lib\pathplan/cvt.c:115: undefined reference to `__imp_makePath'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/inpoly.o: in function `in_poly':
C:\Users\magja\graphviz\lib\pathplan/inpoly.c:32: undefined reference to `__imp_wind'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/shortestpth.o: in function `makePath':
C:\Users\magja\graphviz\lib\pathplan/shortestpth.c:98: undefined reference to `__imp_directVis'
mkFont: make it more obvious to the compiler the extent of 'flags'
All calls to this function use literals that fit in an unsigned char. Squashes
a -Wconversion warning. This also introduces a new header constant,
`GV_TEXTFONT_FLAGS_WIDTH`.
Many callers of `gvjobs_output_langname` were written as if this function
returns `NO_SUPPORT` when given an unsupported language. But this is incorrect.
It returns `FALSE`.
This function is called with int values, but the values are the result of
`getopt`. `getopt` only ever returns -1 (which is handled separately) or a valid
`char` value, so the cast here is always safe and never truncating.
This parameter cannot be removed without breaking API. Doing this does not seem
worth it just to squash a warning. Additionally this function may use the `gvc`
parameter in future.
The ctype.h `is*` functions are typically implemented as macros using a lookup
table. This is fine, but on Cygwin the compiler is somewhat picky about this:
lib/ast/fmtesc.c:116:59: warning: array subscript has type char
[-Wchar-subscripts]
116 | (c == '#' && (b == f || isspace(*(b - 1)))
| ^~~~~~~~
I expect this release to be more turbulent than others in recent times, simply
because of the greater-than-average number of changes since the last release,
both in aggregate as well as specifically to the release process itself.
use 'sed' instead of 'rm;git-checkout' to fix CRLF line endings in Cygwin CI
Only selective artifacts in the repository are sensitive to line endings. E.g.
C/C++ and Python code is happily parsed by the compiler/interpreter regardless
of which line ending style it uses.
This should hopefully accelerate the Cygwin CI tasks slightly. The assumption is
that running `sed` on a few files should be faster than deleting all files and
recreating them.
pic plugin: replace 'pic_string' with 'gvputs_nonascii'
This finishes the process of de-duping `fig_string`, `mp_string`, and
`pic_string`. This change makes this plugin more thread safe (no static buffer
is no longer used), and improves its efficiency (bytes are now written directly
into the output instead of a temporary buffer, requiring dynamic allocation and
two copies).
mp plugin: replace 'mp_string' with 'gvputs_nonascii'
This partially de-dupes some code (`pic_string` is a duplicate of `mp_string`),
makes this plugin more thread safe (no static buffer is no longer used), and
improves its efficiency (bytes are now written directly into the output instead
of a temporary buffer, requiring dynamic allocation and two copies).
fig plugin: replace 'fig_string' with 'gvputs_nonascii'
This partially de-dupes some code (`mp_string` and `pic_string` are duplicates
of `fig_string`), makes this plugin more thread safe (no static buffer is no
longer used), and improves its efficiency (bytes are now written directly into
the output instead of a temporary buffer, requiring dynamic allocation and two
copies).
GDI+ plugin: rewrite 'FileStream' reference counting to be thread safe
Based on Microsoft sample code,¹ it seems like the expectation is that consumers
of the `IStream` API may expect to concurrently manipulate reference counts.
This change guards against this by making the referencing counting code use
lock-free atomics, based on the same Microsoft sample.
Note that this is essentially proactively addressing a latent issue as it is, in
general, unsafe to use Graphviz libraries or plugins in a multithreaded
environment right now.
GDI+ plugin: use 'override' instead of 'virtual' on 'FileStream' methods
This C++11 mechanism is an improvement as it causes compilation to error out if
any of these methods were not already declared virtual in a parent class. That
is, it provides a sanity check that these overrides are really doing what they
intend.