mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
Got rid of ifdefs for long-obsolete GUSI versions.
This commit is contained in:
parent
9b745f6665
commit
8ab04b4d65
7 changed files with 1 additions and 84 deletions
|
@ -149,9 +149,7 @@ Socket methods:
|
|||
# include <netdb.h>
|
||||
typedef size_t socklen_t;
|
||||
# else
|
||||
# ifndef USE_GUSI1
|
||||
# include <arpa/inet.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef RISCOS
|
||||
|
@ -181,11 +179,6 @@ int h_errno; /* not used */
|
|||
# define O_NDELAY O_NONBLOCK /* For QNX only? */
|
||||
#endif
|
||||
|
||||
#ifdef USE_GUSI1
|
||||
/* fdopen() isn't declared in stdio.h (sigh) */
|
||||
# include <GUSI.h>
|
||||
#endif
|
||||
|
||||
#include "addrinfo.h"
|
||||
|
||||
#ifndef HAVE_INET_PTON
|
||||
|
@ -2332,11 +2325,7 @@ PySocket_inet_aton(PyObject *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "s:inet_aton", &ip_addr)) {
|
||||
return NULL;
|
||||
}
|
||||
#ifdef USE_GUSI1
|
||||
packed_addr = inet_addr(ip_addr).s_addr;
|
||||
#else
|
||||
packed_addr = inet_addr(ip_addr);
|
||||
#endif
|
||||
|
||||
if (packed_addr == INADDR_NONE) { /* invalid address */
|
||||
PyErr_SetString(PySocket_Error,
|
||||
|
@ -3331,11 +3320,7 @@ inet_pton (int af, const char *src, void *dst)
|
|||
{
|
||||
if(af == AF_INET){
|
||||
long packed_addr;
|
||||
#ifdef USE_GUSI1
|
||||
packed_addr = (long)inet_addr(src).s_addr;
|
||||
#else
|
||||
packed_addr = inet_addr(src);
|
||||
#endif
|
||||
if (packed_addr == INADDR_NONE)
|
||||
return 0;
|
||||
memcpy(dst, &packed_addr, 4);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue