diff lib-src/pop.c @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 74fd4e045ea6
children 697ef44129c6
line wrap: on
line diff
--- a/lib-src/pop.c	Mon Aug 13 11:18:12 2007 +0200
+++ b/lib-src/pop.c	Mon Aug 13 11:19:21 2007 +0200
@@ -21,6 +21,7 @@
 
 #ifdef HAVE_CONFIG_H
 #define NO_SHORTNAMES	/* Tell config not to load remap.h */
+#define DONT_ENCAPSULATE
 #include <config.h>
 #else
 #define MAIL_USE_POP
@@ -28,16 +29,8 @@
 
 #ifdef MAIL_USE_POP
 
-#ifdef HAVE_CONFIG_H
-/* Cancel these substitutions made in config.h */
-#undef open
-#undef read
-#undef write
-#undef close
-#endif
-
 #include <sys/types.h>
-#ifdef WINDOWSNT
+#ifdef WIN32_NATIVE
 #include <winsock.h>
 #undef SOCKET_ERROR
 #define RECV(s,buf,len,flags) recv(s,buf,len,flags)
@@ -67,16 +60,22 @@
 extern struct servent *hes_getservbyname (/* char *, char * */);
 #endif
 
-#include <pwd.h>
+#include "../src/syspwd.h"
+#ifndef WIN32_NATIVE
 #include <netdb.h>
+#endif
 #include <errno.h>
 #include <stdio.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <sys/stat.h>
+#ifndef WIN32_NATIVE
 #include <sys/file.h>
+#endif
 #include "../src/syswait.h"
-#ifndef WINDOWSNT
+#ifndef WIN32_NATIVE
 #include "../src/systime.h"
 #endif
 #include <stdlib.h>
@@ -103,7 +102,7 @@
 #endif /* ! KRB5 */
 #endif /* KERBEROS */
 
-#ifndef WINDOWSNT
+#ifndef WIN32_NATIVE
 #if !defined(HAVE_H_ERRNO) || !defined(HAVE_CONFIG_H)
 extern int h_errno;
 #endif
@@ -123,7 +122,7 @@
 #define ERROR_MAX 80		/* a pretty arbitrary size */
 #define POP_PORT 110
 #define KPOP_PORT 1109
-#if defined(WINDOWSNT) || defined(__CYGWIN32__)
+#if defined(WIN32_NATIVE) || defined(CYGWIN)
 #define POP_SERVICE "pop3"	/* we don't want the POP2 port! */
 #else
 #define POP_SERVICE "pop"
@@ -184,7 +183,7 @@
       username = getenv ("USER");
       if (! (username && *username))
 	{
-#ifndef WINDOWSNT
+#ifndef WIN32_NATIVE
 	  username = getlogin ();
 	  if (! (username && *username))
 	    {
@@ -253,7 +252,7 @@
  
   if ((! password) && (! DONT_NEED_PASSWORD))
     {
-#ifndef WINDOWSNT
+#ifndef WIN32_NATIVE
       if (! (flags & POP_NO_GETPASS))
 	{
 	  password = getpass ("Enter POP password:");
@@ -932,7 +931,7 @@
   return (ret);
 }
 
-#ifdef WINDOWSNT
+#ifdef WIN32_NATIVE
 static int have_winsock = 0;
 #endif
 
@@ -977,7 +976,7 @@
 
   int try_count = 0;
 
-#ifdef WINDOWSNT
+#ifdef WIN32_NATIVE
   {
     WSADATA winsockData;
     if (WSAStartup (0x101, &winsockData) == 0)
@@ -1482,7 +1481,7 @@
 	}
     }
 
-#ifdef WINDOWSNT
+#ifdef WIN32_NATIVE
   if (have_winsock)
     WSACleanup ();
 #endif