Closed mbiebl closed 8 years ago
The commit which introduced this is f2a8d45d9d4f9bfdba3bb1775b99fdb9fbb1e903
/* here we add some stuff from the compatibility layer. A separate include
* would be cleaner, but would potentially require changes all over the
* place. So doing it here is better.
Adding it to the public API is not better but plain wrong. There might be a possibility to inject that via config.h, if you are concerned about having to include a separate header file.
liblognorm.h contains the following:
This is wrong, though. You can't assume that consumers of your API actually check for the existence of strndup in their configure script and set/unset HAVE_STRNDUP.
The result is, that HAVE_STRNDUP will be unset. This e.g. leads to
You should define the compat strndup in a file like compat.h, which is not included in the public API. C files which use strndup should include that compat.h header.