Date: Mon, 5 Jul 2021 02:22:46 +0000 From: Alexey Dokuchaev <danfe@freebsd.org> To: "Tobias C. Berner" <tcberner@freebsd.org> Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Subject: Re: git: bc02049bf8bb - main - graphics/inkscape: update to 1.1 Message-ID: <YOJs9v8mjWkxEayc@FreeBSD.org> In-Reply-To: <202107042022.164KMF2R002159@gitrepo.freebsd.org>
index | next in thread | previous in thread | raw e-mail
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
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YOJs9v8mjWkxEayc>
