Subject: bug#15094: Fix for posix_memalign on Cygwin

From: Ken Brown <[email-masked]>
Date: Wed, 14 Aug 2013 15:52:53 -0400

On 8/14/2013 3:29 PM, Eli Zaretskii wrote:
> Thanks, but could you please make the commentary more clear?  I'm
> afraid it doesn't make sense to me: if posix_memalign calls memalign,
> then why does the latter have to be renamed, if all you want is for it
> to be called?  Why won't it be called unless renamed?

How's this:

/* Cygwin allows applications to provide their own malloc.  As of
cygwin-1.7.24, applications that provide their own malloc are also
allowed to provide their own posix_memalign (but not memalign).  Calls
to memalign are handled by Cygwin's memalign, which always returns
ENOSYS if the application has defined its own malloc.  So we have to
rename memalign in order to make sure that posix_memalign calls
Emacs's memalign rather than Cygwin's.  */

Ken