Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 3702:3408756ec601 legacy-trunk
changed windows test symbols; removed debug printf from sockets
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 26 Jun 1996 18:22:49 +0000 |
| parents | 931086cb8529 |
| children | ce74bba8a6a6 |
line wrap: on
line diff
--- a/Modules/socketmodule.c Thu Jun 20 16:49:26 1996 +0000 +++ b/Modules/socketmodule.c Wed Jun 26 18:22:49 1996 +0000 @@ -112,7 +112,7 @@ it must be compiled by the C++ compiler, as it takes the address of a static data item exported from the main Python DLL. */ -#ifdef NT +#ifdef MS_WINDOWS /* seem to be a few differences in the API */ #define close closesocket #define NO_DUP /* Actually it exists on NT 3.5, but what the heck... */ @@ -169,7 +169,7 @@ static PyObject * PySocket_Err() { -#ifdef NT +#ifdef MS_WINDOWS if (WSAGetLastError()) { PyObject *v; v = Py_BuildValue("(is)", WSAGetLastError(), "winsock error"); @@ -757,7 +757,7 @@ if (!PyArg_ParseTuple(args, "|si", &mode, &bufsize)) return NULL; -#ifdef NT +#ifdef MS_WIN32 if ( ((fd = _open_osfhandle( s->sock_fd, _O_BINARY )) < 0) || ((fd = dup(fd)) < 0) || ((fp = fdopen(fd, mode)) == NULL)) { #else @@ -817,7 +817,7 @@ return NULL; Py_BEGIN_ALLOW_THREADS n = recvfrom(s->sock_fd, PyString_AsString(buf), len, flags, -#ifndef NT +#ifndef MS_WINDOWS (ANY *)addrbuf, &addrlen); #else (struct sockaddr *)addrbuf, &addrlen); @@ -1250,7 +1250,7 @@ } -#ifdef NT +#ifdef MS_WINDOWS /* Additional initialization and cleanup for NT/Windows */ @@ -1258,7 +1258,6 @@ NTcleanup() { WSACleanup(); - fprintf(stderr, "WSACleanup called\n"); } static int @@ -1289,7 +1288,7 @@ return 0; } -#endif /* NT */ +#endif /* MS_WINDOWS */ /* Initialize this module. @@ -1297,7 +1296,7 @@ via a table in config.c, if config.c is compiled with USE_SOCKET defined. - For NT (which actually means any Windows variant (?)), this module + For MS_WINDOWS (which means any Windows variant), this module is actually called "_socket", and there's a wrapper "socket.py" which implements some missing functionality (such as makefile(), dup() and fromfd()). The import of "_socket" may fail with an @@ -1306,14 +1305,14 @@ scheduled to be made at exit time. */ void -#ifdef NT +#ifdef MS_WINDOWS init_socket() #else initsocket() #endif { PyObject *m, *d; -#ifdef NT +#ifdef MS_WINDOWS if (!NTinit()) return; m = Py_InitModule("_socket", PySocket_methods);
