[MLton] Re: [MLton-commit] r4510

Matthew Fluet fluet@cs.cornell.edu
Wed, 10 May 2006 14:17:25 -0400 (EDT)


> Defined all of the SIG and tty constants with #ifndef in the
> platform-independent code, so that each platform doesn't have to
> define the missing ones.

We've now used this technique for the _SC (sysconf) and _PC (pathconf) 
constants, and the E (errno) constants.  While it is certainly expedient, 
I'm worried that it masks issues.  For example, Wesley added:

// MacOS only defines this if POSIX_C_SOURCE is defined.
// However, defining that breaks half the osx system headers.
// They couldn't possibly change the number at this point anyways.
#ifndef SIGPOLL
#define SIGPOLL 7
#endif

to darwin.h, but he wouldn't have been alerted to this if he had compiled 
the runtime after I added the #ifndef-s for the SIG constants.  (Now, 
admittedly, this signal value isn't exported (or used) by the Basis 
Library, so even if we let it assume the value ~1, it won't affect user 
programs.  But, the sysconf and pathconf constants are a different story, 
since the user may query via string names.)