[MLton-commit] r4508

Matthew Fluet MLton@mlton.org
Tue, 9 May 2006 18:19:57 -0700


Filter missing E constants in ML
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/basis-library/posix/error.sml
U   mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error-consts.c

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/posix/error.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/posix/error.sml	2006-05-10 01:01:40 UTC (rev 4507)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/posix/error.sml	2006-05-10 01:19:57 UTC (rev 4508)
@@ -93,89 +93,95 @@
       val wouldblock = EWOULDBLOCK
       val xdev = EXDEV
 
-      val errorNames =
-         [
-          (acces,"acces"),
-          (addrinuse,"addrinuse"),
-          (addrnotavail,"addrnotavail"),
-          (afnosupport,"afnosupport"),
-          (again,"again"),
-          (already,"already"),
-          (badf,"badf"),
-          (badmsg,"badmsg"),
-          (busy,"busy"),
-          (canceled,"canceled"),
-          (child,"child"),
-          (connaborted,"connaborted"),
-          (connrefused,"connrefused"),
-          (connreset,"connreset"),
-          (deadlk,"deadlk"),
-          (destaddrreq,"destaddrreq"),
-          (dom,"dom"),
-          (dquot,"dquot"),
-          (exist,"exist"),
-          (fault,"fault"),
-          (fbig,"fbig"),
-          (hostunreach,"hostunreach"),
-          (idrm,"idrm"),
-          (ilseq,"ilseq"),
-          (inprogress,"inprogress"),
-          (intr,"intr"),
-          (inval,"inval"),
-          (io,"io"),
-          (isconn,"isconn"),
-          (isdir,"isdir"),
-          (loop,"loop"),
-          (mfile,"mfile"),
-          (mlink,"mlink"),
-          (msgsize,"msgsize"),
-          (multihop,"multihop"),
-          (nametoolong,"nametoolong"),
-          (netdown,"netdown"),
-          (netreset,"netreset"),
-          (netunreach,"netunreach"),
-          (nfile,"nfile"),
-          (nobufs,"nobufs"),
-          (nodata,"nodata"),
-          (nodev,"nodev"),
-          (noent,"noent"),
-          (noexec,"noexec"),
-          (nolck,"nolck"),
-          (nolink,"nolink"),
-          (nomem,"nomem"),
-          (nomsg,"nomsg"),
-          (noprotoopt,"noprotoopt"),
-          (nospc,"nospc"),
-          (nosr,"nosr"),
-          (nostr,"nostr"),
-          (nosys,"nosys"),
-          (notconn,"notconn"),
-          (notdir,"notdir"),
-          (notempty,"notempty"),
-          (notsock,"notsock"),
-          (notsup,"notsup"),
-          (notty,"notty"),
-          (nxio,"nxio"),
-          (opnotsupp,"opnotsupp"),
-          (overflow,"overflow"),
-          (perm,"perm"),
-          (pipe,"pipe"),
-          (proto,"proto"),
-          (protonosupport,"protonosupport"),
-          (prototype,"prototype"),
-          (range,"range"),
-          (rofs,"rofs"),
-          (spipe,"spipe"),
-          (srch,"srch"),
-          (stale,"stale"),
-          (time,"time"),
-          (timedout,"timedout"),
-          (toobig,"toobig"),
-          (txtbsy,"txtbsy"),
-          (wouldblock,"wouldblock"),
-          (xdev,"xdev")
-         ]
-
+      local
+         infixr 5 ::?
+         fun (n,s) ::? l =
+            if n = C_Int.fromInt ~1
+               then l
+               else (n,s) :: l
+      in
+         val errorNames =
+            (acces,"acces") ::?
+            (addrinuse,"addrinuse") ::?
+            (addrnotavail,"addrnotavail") ::?
+            (afnosupport,"afnosupport") ::?
+            (again,"again") ::?
+            (already,"already") ::?
+            (badf,"badf") ::?
+            (badmsg,"badmsg") ::?
+            (busy,"busy") ::?
+            (canceled,"canceled") ::?
+            (child,"child") ::?
+            (connaborted,"connaborted") ::?
+            (connrefused,"connrefused") ::?
+            (connreset,"connreset") ::?
+            (deadlk,"deadlk") ::?
+            (destaddrreq,"destaddrreq") ::?
+            (dom,"dom") ::?
+            (dquot,"dquot") ::?
+            (exist,"exist") ::?
+            (fault,"fault") ::?
+            (fbig,"fbig") ::?
+            (hostunreach,"hostunreach") ::?
+            (idrm,"idrm") ::?
+            (ilseq,"ilseq") ::?
+            (inprogress,"inprogress") ::?
+            (intr,"intr") ::?
+            (inval,"inval") ::?
+            (io,"io") ::?
+            (isconn,"isconn") ::?
+            (isdir,"isdir") ::?
+            (loop,"loop") ::?
+            (mfile,"mfile") ::?
+            (mlink,"mlink") ::?
+            (msgsize,"msgsize") ::?
+            (multihop,"multihop") ::?
+            (nametoolong,"nametoolong") ::?
+            (netdown,"netdown") ::?
+            (netreset,"netreset") ::?
+            (netunreach,"netunreach") ::?
+            (nfile,"nfile") ::?
+            (nobufs,"nobufs") ::?
+            (nodata,"nodata") ::?
+            (nodev,"nodev") ::?
+            (noent,"noent") ::?
+            (noexec,"noexec") ::?
+            (nolck,"nolck") ::?
+            (nolink,"nolink") ::?
+            (nomem,"nomem") ::?
+            (nomsg,"nomsg") ::?
+            (noprotoopt,"noprotoopt") ::?
+            (nospc,"nospc") ::?
+            (nosr,"nosr") ::?
+            (nostr,"nostr") ::?
+            (nosys,"nosys") ::?
+            (notconn,"notconn") ::?
+            (notdir,"notdir") ::?
+            (notempty,"notempty") ::?
+            (notsock,"notsock") ::?
+            (notsup,"notsup") ::?
+            (notty,"notty") ::?
+            (nxio,"nxio") ::?
+            (opnotsupp,"opnotsupp") ::?
+            (overflow,"overflow") ::?
+            (perm,"perm") ::?
+            (pipe,"pipe") ::?
+            (proto,"proto") ::?
+            (protonosupport,"protonosupport") ::?
+            (prototype,"prototype") ::?
+            (range,"range") ::?
+            (rofs,"rofs") ::?
+            (spipe,"spipe") ::?
+            (srch,"srch") ::?
+            (stale,"stale") ::?
+            (time,"time") ::?
+            (timedout,"timedout") ::?
+            (toobig,"toobig") ::?
+            (txtbsy,"txtbsy") ::?
+            (wouldblock,"wouldblock") ::?
+            (xdev,"xdev") ::?
+            []
+      end
       exception SysErr of string * syserror option
 
       val toWord = SysWord.fromLargeInt o C_Int.toLarge

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error-consts.c	2006-05-10 01:01:40 UTC (rev 4507)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error-consts.c	2006-05-10 01:19:57 UTC (rev 4508)
@@ -1,81 +1,319 @@
 #include "platform.h"
 
+#ifndef E2BIG
+#define E2BIG -1
+#endif
 const C_Int_t Posix_Error_E2BIG = E2BIG;
+#ifndef EACCES
+#define EACCES -1
+#endif
 const C_Int_t Posix_Error_EACCES = EACCES;
+#ifndef EADDRINUSE
+#define EADDRINUSE -1
+#endif
 const C_Int_t Posix_Error_EADDRINUSE = EADDRINUSE;
+#ifndef EADDRNOTAVAIL
+#define EADDRNOTAVAIL -1
+#endif
 const C_Int_t Posix_Error_EADDRNOTAVAIL = EADDRNOTAVAIL;
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT -1
+#endif
 const C_Int_t Posix_Error_EAFNOSUPPORT = EAFNOSUPPORT;
+#ifndef EAGAIN
+#define EAGAIN -1
+#endif
 const C_Int_t Posix_Error_EAGAIN = EAGAIN;
+#ifndef EALREADY
+#define EALREADY -1
+#endif
 const C_Int_t Posix_Error_EALREADY = EALREADY;
+#ifndef EBADF
+#define EBADF -1
+#endif
 const C_Int_t Posix_Error_EBADF = EBADF;
+#ifndef EBADMSG
+#define EBADMSG -1
+#endif
 const C_Int_t Posix_Error_EBADMSG = EBADMSG;
+#ifndef EBUSY
+#define EBUSY -1
+#endif
 const C_Int_t Posix_Error_EBUSY = EBUSY;
+#ifndef ECANCELED
+#define ECANCELED -1
+#endif
 const C_Int_t Posix_Error_ECANCELED = ECANCELED;
+#ifndef ECHILD
+#define ECHILD -1
+#endif
 const C_Int_t Posix_Error_ECHILD = ECHILD;
+#ifndef ECONNABORTED
+#define ECONNABORTED -1
+#endif
 const C_Int_t Posix_Error_ECONNABORTED = ECONNABORTED;
+#ifndef ECONNREFUSED
+#define ECONNREFUSED -1
+#endif
 const C_Int_t Posix_Error_ECONNREFUSED = ECONNREFUSED;
+#ifndef ECONNRESET
+#define ECONNRESET -1
+#endif
 const C_Int_t Posix_Error_ECONNRESET = ECONNRESET;
+#ifndef EDEADLK
+#define EDEADLK -1
+#endif
 const C_Int_t Posix_Error_EDEADLK = EDEADLK;
+#ifndef EDESTADDRREQ
+#define EDESTADDRREQ -1
+#endif
 const C_Int_t Posix_Error_EDESTADDRREQ = EDESTADDRREQ;
+#ifndef EDOM
+#define EDOM -1
+#endif
 const C_Int_t Posix_Error_EDOM = EDOM;
+#ifndef EDQUOT
+#define EDQUOT -1
+#endif
 const C_Int_t Posix_Error_EDQUOT = EDQUOT;
+#ifndef EEXIST
+#define EEXIST -1
+#endif
 const C_Int_t Posix_Error_EEXIST = EEXIST;
+#ifndef EFAULT
+#define EFAULT -1
+#endif
 const C_Int_t Posix_Error_EFAULT = EFAULT;
+#ifndef EFBIG
+#define EFBIG -1
+#endif
 const C_Int_t Posix_Error_EFBIG = EFBIG;
+#ifndef EHOSTUNREACH
+#define EHOSTUNREACH -1
+#endif
 const C_Int_t Posix_Error_EHOSTUNREACH = EHOSTUNREACH;
+#ifndef EIDRM
+#define EIDRM -1
+#endif
 const C_Int_t Posix_Error_EIDRM = EIDRM;
+#ifndef EILSEQ
+#define EILSEQ -1
+#endif
 const C_Int_t Posix_Error_EILSEQ = EILSEQ;
+#ifndef EINPROGRESS
+#define EINPROGRESS -1
+#endif
 const C_Int_t Posix_Error_EINPROGRESS = EINPROGRESS;
+#ifndef EINTR
+#define EINTR -1
+#endif
 const C_Int_t Posix_Error_EINTR = EINTR;
+#ifndef EINVAL
+#define EINVAL -1
+#endif
 const C_Int_t Posix_Error_EINVAL = EINVAL;
+#ifndef EIO
+#define EIO -1
+#endif
 const C_Int_t Posix_Error_EIO = EIO;
+#ifndef EISCONN
+#define EISCONN -1
+#endif
 const C_Int_t Posix_Error_EISCONN = EISCONN;
+#ifndef EISDIR
+#define EISDIR -1
+#endif
 const C_Int_t Posix_Error_EISDIR = EISDIR;
+#ifndef ELOOP
+#define ELOOP -1
+#endif
 const C_Int_t Posix_Error_ELOOP = ELOOP;
+#ifndef EMFILE
+#define EMFILE -1
+#endif
 const C_Int_t Posix_Error_EMFILE = EMFILE;
+#ifndef EMLINK
+#define EMLINK -1
+#endif
 const C_Int_t Posix_Error_EMLINK = EMLINK;
+#ifndef EMSGSIZE
+#define EMSGSIZE -1
+#endif
 const C_Int_t Posix_Error_EMSGSIZE = EMSGSIZE;
+#ifndef EMULTIHOP
+#define EMULTIHOP -1
+#endif
 const C_Int_t Posix_Error_EMULTIHOP = EMULTIHOP;
+#ifndef ENAMETOOLONG
+#define ENAMETOOLONG -1
+#endif
 const C_Int_t Posix_Error_ENAMETOOLONG = ENAMETOOLONG;
+#ifndef ENETDOWN
+#define ENETDOWN -1
+#endif
 const C_Int_t Posix_Error_ENETDOWN = ENETDOWN;
+#ifndef ENETRESET
+#define ENETRESET -1
+#endif
 const C_Int_t Posix_Error_ENETRESET = ENETRESET;
+#ifndef ENETUNREACH
+#define ENETUNREACH -1
+#endif
 const C_Int_t Posix_Error_ENETUNREACH = ENETUNREACH;
+#ifndef ENFILE
+#define ENFILE -1
+#endif
 const C_Int_t Posix_Error_ENFILE = ENFILE;
+#ifndef ENOBUFS
+#define ENOBUFS -1
+#endif
 const C_Int_t Posix_Error_ENOBUFS = ENOBUFS;
+#ifndef ENODATA
+#define ENODATA -1
+#endif
 const C_Int_t Posix_Error_ENODATA = ENODATA;
+#ifndef ENODEV
+#define ENODEV -1
+#endif
 const C_Int_t Posix_Error_ENODEV = ENODEV;
+#ifndef ENOENT
+#define ENOENT -1
+#endif
 const C_Int_t Posix_Error_ENOENT = ENOENT;
+#ifndef ENOEXEC
+#define ENOEXEC -1
+#endif
 const C_Int_t Posix_Error_ENOEXEC = ENOEXEC;
+#ifndef ENOLCK
+#define ENOLCK -1
+#endif
 const C_Int_t Posix_Error_ENOLCK = ENOLCK;
+#ifndef ENOLINK
+#define ENOLINK -1
+#endif
 const C_Int_t Posix_Error_ENOLINK = ENOLINK;
+#ifndef ENOMEM
+#define ENOMEM -1
+#endif
 const C_Int_t Posix_Error_ENOMEM = ENOMEM;
+#ifndef ENOMSG
+#define ENOMSG -1
+#endif
 const C_Int_t Posix_Error_ENOMSG = ENOMSG;
+#ifndef ENOPROTOOPT
+#define ENOPROTOOPT -1
+#endif
 const C_Int_t Posix_Error_ENOPROTOOPT = ENOPROTOOPT;
+#ifndef ENOSPC
+#define ENOSPC -1
+#endif
 const C_Int_t Posix_Error_ENOSPC = ENOSPC;
+#ifndef ENOSR
+#define ENOSR -1
+#endif
 const C_Int_t Posix_Error_ENOSR = ENOSR;
+#ifndef ENOSTR
+#define ENOSTR -1
+#endif
 const C_Int_t Posix_Error_ENOSTR = ENOSTR;
+#ifndef ENOSYS
+#define ENOSYS -1
+#endif
 const C_Int_t Posix_Error_ENOSYS = ENOSYS;
+#ifndef ENOTCONN
+#define ENOTCONN -1
+#endif
 const C_Int_t Posix_Error_ENOTCONN = ENOTCONN;
+#ifndef ENOTDIR
+#define ENOTDIR -1
+#endif
 const C_Int_t Posix_Error_ENOTDIR = ENOTDIR;
+#ifndef ENOTEMPTY
+#define ENOTEMPTY -1
+#endif
 const C_Int_t Posix_Error_ENOTEMPTY = ENOTEMPTY;
+#ifndef ENOTSOCK
+#define ENOTSOCK -1
+#endif
 const C_Int_t Posix_Error_ENOTSOCK = ENOTSOCK;
+#ifndef ENOTSUP
+#define ENOTSUP -1
+#endif
 const C_Int_t Posix_Error_ENOTSUP = ENOTSUP;
+#ifndef ENOTTY
+#define ENOTTY -1
+#endif
 const C_Int_t Posix_Error_ENOTTY = ENOTTY;
+#ifndef ENXIO
+#define ENXIO -1
+#endif
 const C_Int_t Posix_Error_ENXIO = ENXIO;
+#ifndef EOPNOTSUPP
+#define EOPNOTSUPP -1
+#endif
 const C_Int_t Posix_Error_EOPNOTSUPP = EOPNOTSUPP;
+#ifndef EOVERFLOW
+#define EOVERFLOW -1
+#endif
 const C_Int_t Posix_Error_EOVERFLOW = EOVERFLOW;
+#ifndef EPERM
+#define EPERM -1
+#endif
 const C_Int_t Posix_Error_EPERM = EPERM;
+#ifndef EPIPE
+#define EPIPE -1
+#endif
 const C_Int_t Posix_Error_EPIPE = EPIPE;
+#ifndef EPROTO
+#define EPROTO -1
+#endif
 const C_Int_t Posix_Error_EPROTO = EPROTO;
+#ifndef EPROTONOSUPPORT
+#define EPROTONOSUPPORT -1
+#endif
 const C_Int_t Posix_Error_EPROTONOSUPPORT = EPROTONOSUPPORT;
+#ifndef EPROTOTYPE
+#define EPROTOTYPE -1
+#endif
 const C_Int_t Posix_Error_EPROTOTYPE = EPROTOTYPE;
+#ifndef ERANGE
+#define ERANGE -1
+#endif
 const C_Int_t Posix_Error_ERANGE = ERANGE;
+#ifndef EROFS
+#define EROFS -1
+#endif
 const C_Int_t Posix_Error_EROFS = EROFS;
+#ifndef ESPIPE
+#define ESPIPE -1
+#endif
 const C_Int_t Posix_Error_ESPIPE = ESPIPE;
+#ifndef ESRCH
+#define ESRCH -1
+#endif
 const C_Int_t Posix_Error_ESRCH = ESRCH;
+#ifndef ESTALE
+#define ESTALE -1
+#endif
 const C_Int_t Posix_Error_ESTALE = ESTALE;
+#ifndef ETIME
+#define ETIME -1
+#endif
 const C_Int_t Posix_Error_ETIME = ETIME;
+#ifndef ETIMEDOUT
+#define ETIMEDOUT -1
+#endif
 const C_Int_t Posix_Error_ETIMEDOUT = ETIMEDOUT;
+#ifndef ETXTBSY
+#define ETXTBSY -1
+#endif
 const C_Int_t Posix_Error_ETXTBSY = ETXTBSY;
+#ifndef EWOULDBLOCK
+#define EWOULDBLOCK -1
+#endif
 const C_Int_t Posix_Error_EWOULDBLOCK = EWOULDBLOCK;
+#ifndef EXDEV
+#define EXDEV -1
+#endif
 const C_Int_t Posix_Error_EXDEV = EXDEV;
+