[MLton] x86_64 port status
Stephen Weeks
MLton@mlton.org
Sun, 7 May 2006 10:02:22 -0700
> My gut reaction, adding #include "platform.h" to gen-types.c, didn't
> help since it seems that platform.h depends on c-types.h (generated
> by gen-types). So including platform.h from gen-types.c causes a
> cyclic dependency.
>
> This is unfortunate, as it forces duplication of platform specific
> #ifs unless something is refactored. As of yet I have no proposal
> on what to refactor and how, though.
It seems like one could factor out the following.
----------------------------------------------------------------------
#include "cenv.h"
#if (defined (__APPLE_CC__))
#define __Darwin__
#endif
#if (defined (__CYGWIN__))
#include "platform/cygwin.h"
#elif (defined (__Darwin__))
#include "platform/darwin.h"
#elif (defined (__FreeBSD__))
#include "platform/freebsd.h"
#elif (defined (__hpux__))
#include "platform/hpux.h"
#elif (defined (__linux__))
#include "platform/linux.h"
#elif (defined (__MINGW32__))
#include "platform/mingw.h"
#elif (defined (__NetBSD__))
#include "platform/netbsd.h"
#elif (defined (__OpenBSD__))
#include "platform/openbsd.h"
#elif (defined (__sun__))
#include "platform/solaris.h"
#else
#error unknown platform
#endif