Skip to content

gh-108765: Remove old prototypes from pyport.h - #108782

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:prototypes
Sep 2, 2023
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:prototypes

Conversation

@vstinner

@vstinner vstinner commented Sep 1, 2023 •

Copy link
Copy Markdown
Member

Move prototypes of gethostname(), _getpty() and struct termios from pyport.h to the C code using them: posixmodule.c, socketmodule.c and termios.c.

Replace "#ifdef SOLARIS" with "#ifdef __sun".

Move prototypes of gethostname(), _getpty() and struct termios from
pyport.h to the C code using them: posixmodule.c, socketmodule.c and
termios.c.

Replace "#ifdef SOLARIS" with "#ifdef __sun".
@vstinner

vstinner commented Sep 2, 2023

Copy link
Copy Markdown
Member Author

Buildbots are happy with this change: #108784

@vstinner
vstinner merged commit 1f3e797 into python:main Sep 2, 2023
@vstinner
vstinner deleted the prototypes branch September 2, 2023 13:46
@vstinner

vstinner commented Sep 2, 2023

Copy link
Copy Markdown
Member Author

@kulikjak: It would be nice if you can double check the Solaris change:

Replace "#ifdef SOLARIS" with "#ifdef __sun".
@kulikjak

kulikjak commented Sep 2, 2023

Copy link
Copy Markdown
Contributor

Hi @vstinner, can you, please, remove this part completely? There is already and issue and PR for this that is forgotten a little:
#63760
#23208

As mentioned there, gethostname() is defined now and both Oracle Solaris and OpenSolaris forks remove it:
https://github.com/oracle/solaris-userland/blob/master/components/python/python37/patches/15-gethostname.patch
https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/python/python37/patches/15-gethostname.patch
https://github.com/omniosorg/omnios-build/blob/master/build/python27/patches/24-gethostname.patch

As for the define guard, if defined(__sun) && defined(__SVR4) is the best way to detect Solaris. (Although I guess there isn't that many people running 30+ years old pre SRV4 SunOS systems and building latest Python :))

@kulikjak

kulikjak commented Sep 2, 2023

Copy link
Copy Markdown
Contributor

I just realized that it's merged already - I rebased that older PR to remove it.
#23208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants