[MLton] C99 runtime problems on Darwin

Wesley W. Terpstra terpstra@gkec.tu-darmstadt.de
Thu, 23 Dec 2004 04:47:39 +0100


On Wed, Dec 22, 2004 at 06:05:45PM -0800, Stephen Weeks wrote:
> > Including platform.h at the top of every C file (at least before any
> > non-comments) and having it do the #defines first will definitely work.
> 
> OK, I've done this.  I left the following #defines in place, because I
> wasn't sure if it made sense to move them to platform.h as well.
> 
> platform/cygwin.c:#define _GNU_SOURCE
> platform/freebsd.c:#define _XOPEN_SOURCE 600
> platform/linux.c:#define _GNU_SOURCE
> platform/mingw.c:#define _GNU_SOURCE
> platform/netbsd.c:#define _XOPEN_SOURCE 600
> platform/openbsd.c:#define _XOPEN_SOURCE 600
> platform/solaris.c:#define _XOPEN_SOURCE 600
> gc.c:#define _GNU_SOURCE

The _XOPEN_SOURCE 600 can go; POSIX 200112 is enough.
The _GNU_SOURCE is needed for mremap.

Ideally, I would move heapRemap out of gc.c and into platform/mremap.c.
Then you don't need the _GNU_SOURCE in gc.c; only in linux.c and cygwin.c
where it makes the most sense anyways---platform dependant.
One less macro to manage that way too.

-- 
Wesley W. Terpstra