Created attachment 28673 [details] [review] Workaround While strnlen is now in POSIX 2008, it is not yet available on all systems. NetBSD-current only recently added it in May, so the last release doesn't have it. Since it is only used in one file, a possible workaround is attached.
This is 2011. Is the workaround needed anymore?
Yes. NetBSD-5.1, the latest release, doesn't have strnlen. If you don't like applying the patch, just close the bug report and we'll keep the patch in pkgsrc; that fixes the issue for most NetBSD users. There might be other operating systems that don't support it though (e.g. Solaris added it after Solaris 9, not sure if it's in 10).
#ifndef doesn't work on functions — you're actually redefining strnlen on all platforms. :) I've committed a slightly modified version: <http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=dbc99e7>. It will be released in 0.1.9. Thanks for the report!
*** Bug 15027 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.