[PATCH 2 of 2] osutil.c: replace alloca() with malloc() and remove <alloca.h>
Benoit Boissinot
bboissin at gmail.com
Sun Oct 7 21:28:38 UTC 2007
On 10/7/07, Benoit Boissinot <bboissin at gmail.com> wrote:
> On 10/7/07, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> > The <alloca.h> header is not really portable, and it breaks Mercurial on
> > FreeBSD. Remove the dependency on <alloca.h> and alloca() by replacing
> > the only place where it was used with malloc().
>
> (I think alloca is defined in stdlib.h in freebsd)
>
I've seen the following code in other places:
#if defined(__FreeBSD__)
#include <stdlib.h>
#elif defined(_WIN32)
#include <malloc.h>
#else
#include <alloca.h>
#endif
More information about the Mercurial-devel
mailing list