mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Slightly different Windows ifdefs
This commit is contained in:
parent
919c576254
commit
6f489d989d
4 changed files with 8 additions and 9 deletions
|
@ -34,7 +34,7 @@ have any value except INVALID_SOCKET.
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef MS_WINDOWS
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#else
|
#else
|
||||||
#include "myselect.h" /* Also includes mytime.h */
|
#include "myselect.h" /* Also includes mytime.h */
|
||||||
|
|
|
@ -82,7 +82,7 @@ Socket methods:
|
||||||
#include "mytime.h"
|
#include "mytime.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#ifndef _MSC_VER
|
#ifndef MS_WINDOWS
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -487,7 +487,7 @@ BUILD_FUNC_DEF_2(PySocketSock_setblocking,PySocketSockObject*,s,PyObject*,args)
|
||||||
if (!PyArg_GetInt(args, &block))
|
if (!PyArg_GetInt(args, &block))
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
#ifndef _MSC_VER
|
#ifndef MS_WINDOWS
|
||||||
delay_flag = fcntl (s->sock_fd, F_GETFL, 0);
|
delay_flag = fcntl (s->sock_fd, F_GETFL, 0);
|
||||||
if (block)
|
if (block)
|
||||||
delay_flag &= (~O_NDELAY);
|
delay_flag &= (~O_NDELAY);
|
||||||
|
@ -1108,7 +1108,7 @@ static PyObject *
|
||||||
BUILD_FUNC_DEF_2(PySocket_socket,PyObject *,self, PyObject *,args)
|
BUILD_FUNC_DEF_2(PySocket_socket,PyObject *,self, PyObject *,args)
|
||||||
{
|
{
|
||||||
PySocketSockObject *s;
|
PySocketSockObject *s;
|
||||||
#ifdef _MSC_VER
|
#ifdef MS_WINDOWS
|
||||||
SOCKET fd;
|
SOCKET fd;
|
||||||
#else
|
#else
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -1119,7 +1119,7 @@ BUILD_FUNC_DEF_2(PySocket_socket,PyObject *,self, PyObject *,args)
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
fd = socket(family, type, proto);
|
fd = socket(family, type, proto);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
#ifdef _MSC_VER
|
#ifdef MS_WINDOWS
|
||||||
if (fd == INVALID_SOCKET)
|
if (fd == INVALID_SOCKET)
|
||||||
#else
|
#else
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
|
|
|
@ -415,7 +415,7 @@ find_module(name, path, buf, buflen, p_fp)
|
||||||
struct filedescr *fdp;
|
struct filedescr *fdp;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
|
|
||||||
#ifdef NT
|
#ifdef PYTHONWIN
|
||||||
if ((fp=PyWin_FindRegisteredModule(name, &fdp, buf, buflen))!=NULL) {
|
if ((fp=PyWin_FindRegisteredModule(name, &fdp, buf, buflen))!=NULL) {
|
||||||
*p_fp = fp;
|
*p_fp = fp;
|
||||||
return fdp;
|
return fdp;
|
||||||
|
@ -463,12 +463,11 @@ find_module(name, path, buf, buflen, p_fp)
|
||||||
buf[len++] = ch;
|
buf[len++] = ch;
|
||||||
}
|
}
|
||||||
else /* Not in dos_8x3, use the full name */
|
else /* Not in dos_8x3, use the full name */
|
||||||
#else
|
#endif
|
||||||
{
|
{
|
||||||
strcpy(buf+len, name);
|
strcpy(buf+len, name);
|
||||||
len += namelen;
|
len += namelen;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
for (fdp = import_filetab; fdp->suffix != NULL; fdp++) {
|
for (fdp = import_filetab; fdp->suffix != NULL; fdp++) {
|
||||||
strcpy(buf+len, fdp->suffix);
|
strcpy(buf+len, fdp->suffix);
|
||||||
if (verbose > 1)
|
if (verbose > 1)
|
||||||
|
|
|
@ -269,7 +269,7 @@ initsys()
|
||||||
dictinsert(sysdict, "builtin_module_names",
|
dictinsert(sysdict, "builtin_module_names",
|
||||||
v = list_builtin_module_names());
|
v = list_builtin_module_names());
|
||||||
XDECREF(v);
|
XDECREF(v);
|
||||||
#ifdef NT
|
#ifdef PYTHONWIN
|
||||||
dictinsert(sysdict, "dllhandle", v = newintobject((int)PyWin_DLLhModule));
|
dictinsert(sysdict, "dllhandle", v = newintobject((int)PyWin_DLLhModule));
|
||||||
XDECREF(v);
|
XDECREF(v);
|
||||||
dictinsert(sysdict, "winver", v = newstringobject(WIN32_PATCH_LEVEL));
|
dictinsert(sysdict, "winver", v = newstringobject(WIN32_PATCH_LEVEL));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue