[Python-Dev] ANSIfication.

M.-A. Lemburg mal@lemburg.com
Sun, 23 Jul 2000 14:28:36 +0200

Thomas Wouters wrote:
> I'm also tempted to suggest to remove most of the 'extern's, and possibly
> add them to pyport.h if they are still an issue. Most of the current externs
> for library functions seem to me like old cruft, though I have no way of
> telling how old they are. The getopt() prototype would be solved that way,
> in any case, by removing it and relying on the appropriate include file
> defining it.
> Here's an example of what I think is old cruft:
> posixmodule.c:
> /* XXX These are for SunOS4.1.3 but shouldn't hurt elsewhere */
> extern int rename(const char *, const char *);
> extern int pclose(FILE *);
> extern int lstat(const char *, struct stat *);
> extern int symlink(const char *, const char *);
> extern int fsync(int fd);

I'd suggest doing this in two steps:

1. move the externs to pyport.h (which is the right place for
   these platform dependent defines and includes) and 
   add #if 0 ... #endif around them

2. check whether these are still needed during the beta phase and 
   if no one complains remove the cruft completely

Alternatively, you could also add specific platform dependent
#ifdefs to pyport.h which only enable the externs on those
platforms where they are needed.

Marc-Andre Lemburg
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/