Commits

Guido van Rossum  committed ce74bba

Slightly different Windows ifdefs

  • Participants
  • Parent commits 6b1b664
  • Branches legacy-trunk

Comments (0)

Files changed (4)

File Modules/selectmodule.c

 
 #include <sys/types.h>
 
-#ifdef _MSC_VER
+#ifdef MS_WINDOWS
 #include <winsock.h>
 #else
 #include "myselect.h" /* Also includes mytime.h */

File Modules/socketmodule.c

 #include "mytime.h"
 
 #include <signal.h>
-#ifndef _MSC_VER
+#ifndef MS_WINDOWS
 #include <netdb.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 	if (!PyArg_GetInt(args, &block))
 		return NULL;
 	Py_BEGIN_ALLOW_THREADS
-#ifndef _MSC_VER
+#ifndef MS_WINDOWS
 	delay_flag = fcntl (s->sock_fd, F_GETFL, 0);
 	if (block)
 		delay_flag &= (~O_NDELAY);
 BUILD_FUNC_DEF_2(PySocket_socket,PyObject *,self, PyObject *,args)
 {
 	PySocketSockObject *s;
-#ifdef _MSC_VER
+#ifdef MS_WINDOWS
 	SOCKET fd;
 #else
 	int fd;
 	Py_BEGIN_ALLOW_THREADS
 	fd = socket(family, type, proto);
 	Py_END_ALLOW_THREADS
-#ifdef _MSC_VER
+#ifdef MS_WINDOWS
 	if (fd == INVALID_SOCKET)
 #else
 	if (fd < 0)

File Python/import.c

 	struct filedescr *fdp;
 	FILE *fp = NULL;
 
-#ifdef NT
+#ifdef PYTHONWIN
 	if ((fp=PyWin_FindRegisteredModule(name, &fdp, buf, buflen))!=NULL) {
 		*p_fp = fp;
 		return fdp;
 					buf[len++] = ch;
 		}
 		else /* Not in dos_8x3, use the full name */
-#else
+#endif
 		{
 			strcpy(buf+len, name);
 			len += namelen;
 		}
-#endif
 		for (fdp = import_filetab; fdp->suffix != NULL; fdp++) {
 			strcpy(buf+len, fdp->suffix);
 			if (verbose > 1)

File Python/sysmodule.c

 	dictinsert(sysdict, "builtin_module_names",
 		   v = list_builtin_module_names());
 	XDECREF(v);
-#ifdef NT
+#ifdef PYTHONWIN
 	dictinsert(sysdict, "dllhandle", v = newintobject((int)PyWin_DLLhModule));
 	XDECREF(v);
 	dictinsert(sysdict, "winver", v = newstringobject(WIN32_PATCH_LEVEL));