From 359c1e017ee367c34b082b1b4e6c002686d01bce Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 04:24:09 +0000 Subject: works on Linux 2.6 --- src/cmd/postscript/common/bbox.c | 1 + src/cmd/postscript/common/getopt.c | 11 +++-------- src/cmd/postscript/common/misc.c | 1 + src/cmd/postscript/common/mkfile | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/cmd/postscript/common') diff --git a/src/cmd/postscript/common/bbox.c b/src/cmd/postscript/common/bbox.c index 66a114c2..67dabf32 100644 --- a/src/cmd/postscript/common/bbox.c +++ b/src/cmd/postscript/common/bbox.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include diff --git a/src/cmd/postscript/common/getopt.c b/src/cmd/postscript/common/getopt.c index e348cb2f..018885f7 100644 --- a/src/cmd/postscript/common/getopt.c +++ b/src/cmd/postscript/common/getopt.c @@ -1,18 +1,13 @@ -#ifndef _POSIX_SOURCE -#include -#include -#endif #include +#include #define ERR(str, chr) if(opterr){fprintf(stderr, "%s%s%c\n", argv[0], str, chr);} int opterr = 1; int optind = 1; int optopt; char *optarg; -char *strchr(); int -getopt (argc, argv, opts) -char **argv, *opts; +getopt (int argc, char **argv, char *opts) { static int sp = 1; register int c; @@ -22,7 +17,7 @@ char **argv, *opts; if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') return EOF; - else if (strcmp(argv[optind], "--") == NULL) { + else if (strcmp(argv[optind], "--") == 0) { optind++; return EOF; } diff --git a/src/cmd/postscript/common/misc.c b/src/cmd/postscript/common/misc.c index e965a6ee..dd34c6db 100644 --- a/src/cmd/postscript/common/misc.c +++ b/src/cmd/postscript/common/misc.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff --git a/src/cmd/postscript/common/mkfile b/src/cmd/postscript/common/mkfile index 121b739e..6e270bca 100644 --- a/src/cmd/postscript/common/mkfile +++ b/src/cmd/postscript/common/mkfile @@ -20,4 +20,4 @@ HFILES=comments.h\ <$PLAN9/src/mklib -CFLAGS=-c -D$SYSTEM -D_POSIX_SOURCE +CFLAGS=-c -D$SYSTEM -- cgit v1.2.3