X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tools-for-build%2Fgrovel_headers.c;h=0d330824b1535c2ace010f883cbccdbc6f43c82d;hb=b84b7f3a3c58909c6e252aba8c97148c9ad917b7;hp=bcba0882dbeb74a7861ef209a0ecf8a47997d0e4;hpb=63fcb94b875a97e468d9add229e220ecceec2352;p=sbcl.git diff --git a/tools-for-build/grovel_headers.c b/tools-for-build/grovel_headers.c index bcba088..0d33082 100644 --- a/tools-for-build/grovel_headers.c +++ b/tools-for-build/grovel_headers.c @@ -22,10 +22,12 @@ #include #include #include +#include #include +#include #define DEFTYPE(lispname,cname) { cname foo; \ - printf("(def-alien-type "##lispname##" (%s %d))\n", (((foo=-1)<0) ? "sb!alien:signed" : "unsigned"), (8 * (sizeof foo))); } + printf("(define-alien-type " lispname " (%s %d))\n", (((foo=-1)<0) ? "sb!alien:signed" : "unsigned"), (8 * (sizeof foo))); } void defconstant(char* lisp_name, long unix_number) @@ -45,26 +47,27 @@ main(int argc, char *argv[]) /* don't need no steenking hand-editing */ printf( -";;;; This is an automatically generated file, please do not hand-edit it. -;;;; See the program \"grovel_headers.c\". - +";;;; This is an automatically generated file, please do not hand-edit it.\n\ +;;;; See the program \"grovel_headers.c\".\n\ +\n\ "); printf("(in-package \"SB!UNIX\")\n\n"); printf(";;; types, types, types\n"); + DEFTYPE("clock-t", clock_t); DEFTYPE("dev-t", dev_t); + DEFTYPE("gid-t", gid_t); DEFTYPE("ino-t", ino_t); DEFTYPE("mode-t", mode_t); DEFTYPE("nlink-t", nlink_t); - DEFTYPE("uid-t", uid_t); - DEFTYPE("gid-t", gid_t); - DEFTYPE("clock-t", clock_t); DEFTYPE("off-t", off_t); + DEFTYPE("size-t", size_t); DEFTYPE("time-t", time_t); + DEFTYPE("uid-t", uid_t); printf("\n"); - printf(";;; fcntl.h\n"); + printf(";;; fcntl.h (or unistd.h on OpenBSD)\n"); defconstant("r_ok", R_OK); defconstant("w_ok", W_OK); defconstant("x_ok", X_OK); @@ -82,16 +85,21 @@ main(int argc, char *argv[]) defconstant("o_trunc", O_TRUNC); defconstant("o_append", O_APPEND); printf(";;;\n"); - defconstant( "s-ifmt", S_IFMT); - defconstant( "s-ififo", S_IFIFO); - defconstant( "s-ifchr", S_IFCHR); - defconstant( "s-ifdir", S_IFDIR); - defconstant( "s-ifblk", S_IFBLK); - defconstant( "s-ifreg", S_IFREG); + defconstant("s-ifmt", S_IFMT); + defconstant("s-ififo", S_IFIFO); + defconstant("s-ifchr", S_IFCHR); + defconstant("s-ifdir", S_IFDIR); + defconstant("s-ifblk", S_IFBLK); + defconstant("s-ifreg", S_IFREG); printf("\n"); - defconstant( "s-iflnk", S_IFLNK); - defconstant( "s-ifsock", S_IFSOCK); + defconstant("s-iflnk", S_IFLNK); + defconstant("s-ifsock", S_IFSOCK); + printf("\n"); + + printf(";;; for wait3(2) in run-program.lisp\n"); + defconstant("wnohang", WNOHANG); + defconstant("wuntraced", WUNTRACED); printf("\n"); return 0;