diff options
author | Thomas Wouters <thomas@python.org> | 2000-11-03 08:18:37 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2000-11-03 08:18:37 (GMT) |
commit | 2cffc7d4202fc1197280a05d998075551b459283 (patch) | |
tree | 7c5d86617226e1517840a60c44bd21183160b3e0 /Demo/pysvr | |
parent | 9dce7b3737c456f3c6f56f1f57c29b3c3b6b20aa (diff) | |
download | cpython-2cffc7d4202fc1197280a05d998075551b459283.zip cpython-2cffc7d4202fc1197280a05d998075551b459283.tar.gz cpython-2cffc7d4202fc1197280a05d998075551b459283.tar.bz2 |
Move our own getopt() implementation to _PyOS_GetOpt(), and use it
regardless of whether the system getopt() does what we want. This avoids the
hassle with prototypes and externs, and the check to see if the system
getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to
avoid name clashes. Add new include file to define the right symbols. Fix
Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on
Python to provide it.
Diffstat (limited to 'Demo/pysvr')
-rw-r--r-- | Demo/pysvr/pysvr.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Demo/pysvr/pysvr.c b/Demo/pysvr/pysvr.c index d7d755c..99d7b07 100644 --- a/Demo/pysvr/pysvr.c +++ b/Demo/pysvr/pysvr.c @@ -19,6 +19,7 @@ can log in on your machine. Use with caution! #include <netinet/in.h> #include <pthread.h> +#include <getopt.h> /* XXX Umpfh. Python.h defines a typedef destructor, which conflicts with pthread.h. @@ -32,10 +33,6 @@ extern int Py_VerboseFlag; #define PORT 4000 #endif -extern int optind; -extern char *optarg; -extern int getopt(int, char **, char *); - struct workorder { int conn; struct sockaddr_in addr; |