Bug 101582 - error: use of undeclared identifier 'strnlen'
Summary: error: use of undeclared identifier 'strnlen'
Status: RESOLVED WONTFIX
Alias: None
Product: libopenraw
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Hubert Figuiere
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-25 04:41 UTC by Ryan Schmidt
Modified: 2018-02-04 00:35 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.