libepoxy icon indicating copy to clipboard operation
libepoxy copied to clipboard

How better to implement strndup for MacOS versions that do not have it? (needed for EGL)

Open barracuda156 opened this issue 1 year ago • 0 comments

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

barracuda156 avatar Sep 05 '22 18:09 barracuda156