libepoxy
libepoxy copied to clipboard
How better to implement strndup for MacOS versions that do not have it? (needed for EGL)
Two source file related to EGL use strndup
which is missing on MacOS X < 10.7 – egl_has_extension_nocontext.c
and egl_epoxy_api.c
.
In Macports we can use legacysupport
PortGroup, which provides needed definition:
https://github.com/macports/macports-legacy-support/blob/master/include/string.h
I guess it can be borrowed and included either directly in those 2 files or in a header common to them. Condition can be something like:
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
[put definition here]
#endif
#endif