Bug 101582

Summary: error: use of undeclared identifier 'strnlen'
Product: libopenraw Reporter: Ryan Schmidt <freedesktop>
Component: GeneralAssignee: Hubert Figuiere <hub>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Ryan Schmidt 2017-06-25 04:41:33 UTC
libopenraw 0.1.2 fails to build on operating systems that do not have strnlen, such as Mac OS X 10.6 and earlier.

./ifdentry.hpp:118:30: error: use of undeclared identifier 'strnlen'
    s.assign((const char*)b, strnlen((const char*)b, len));
                             ^
Comment 1 Hubert Figuiere 2017-08-09 03:44:58 UTC
MacOS X 10.6 is no longer supported by its vendor nor by app vendors.

If you have a patch to fix it, I can consider it. Otherwise, my resources are limited.
Comment 2 Ryan Schmidt 2018-02-04 00:35:38 UTC
A fix for this was committed to MacPorts:

https://github.com/macports/macports-ports/blob/40ad96d20cf6c42bd6a92d6f35d847c4ab2c6e3d/graphics/libopenraw/files/patch-ifdentry.hpp.diff

This works for us since we're focused on macOS, but old versions of other BSD-derived operating systems probably lack strnlen as well, so a better upstream fix would be to test in the configure script whether strnlen exists, and if not, use the compatibility implementation.

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.