git: bc02049bf8bb - main - graphics/inkscape: update to 1.1
Alexey Dokuchaev
danfe at freebsd.org
Mon Jul 5 02:22:46 UTC 2021
On Sun, Jul 04, 2021 at 08:22:15PM +0000, Tobias C. Berner wrote:
> commit bc02049bf8bbba23d78ca07d75c02d7940b98995
>
> graphics/inkscape: update to 1.1
>
> ...
> +-#ifdef __APPLE__
> ++#if defined(__APPLE__) || defined(__FreeBSD__)
> + // workaround for
> + // static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value
> + auto const n = std::vector<Inkscape::XML::Node *>(nodes.begin(), nodes.end());
Interesting... Is this the bug in Clang or Inkscape?
> ++#elif defined(__FreeBSD__)
> ++ int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
> ++ char buf[MAXPATHLEN];
> ++ size_t cb = sizeof(buf);
> ++ if (sysctl(mib, 4, buf, &cb, NULL, 0) == 0) {
> ++ program_name = realpath(buf, nullptr);
I've recently had to patch one program in a similar way, and it looks
like returned path is already normalized on FreeBSD, so you don't have
to call realpath(), contrary to Linux' /proc/self/exe. If the buffer
is expected to be free()able, s/char buf[...]/char *buf = malloc(...)/
and change the condition to ``if (!buf || sysctl(...) == -1)'' as they
both would set errno and thus could be handled in one if().
./danfe
More information about the dev-commits-ports-all
mailing list