summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/anopesmtp.c17
-rw-r--r--src/tools/smtp.h33
2 files changed, 45 insertions, 5 deletions
diff --git a/src/tools/anopesmtp.c b/src/tools/anopesmtp.c
index 12949c9f9..910caa3bc 100644
--- a/src/tools/anopesmtp.c
+++ b/src/tools/anopesmtp.c
@@ -20,6 +20,23 @@ static int curday = 0;
/*************************************************************************/
+#ifdef _WIN32
+int strcasecmp(const char *s1, const char *s2)
+{
+ register int c;
+
+ while ((c = tolower(*s1)) == tolower(*s2)) {
+ if (c == 0)
+ return 0;
+ s1++;
+ s2++;
+ }
+ if (c < tolower(*s2))
+ return -1;
+ return 1;
+}
+#endif
+
static int get_logname(char *name, int count, struct tm *tm)
{
diff --git a/src/tools/smtp.h b/src/tools/smtp.h
index bce460684..7ffda89e8 100644
--- a/src/tools/smtp.h
+++ b/src/tools/smtp.h
@@ -24,21 +24,39 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+/* Windows does not have:
+ * unistd.h, grp.h,
+ * netdb.h, netinet/in.h,
+ * sys/socket.h, sys/time.h
+ * Windows requires:
+ * winsock.h
+ * -- codemastr
+ */
+
+#ifndef _WIN32
#include <unistd.h>
+#endif
+
#include <signal.h>
#include <time.h>
#include <errno.h>
-#include <grp.h>
#include <limits.h>
+
+#ifndef _WIN32
#include <netdb.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
#include <sys/socket.h>
-#include <sys/stat.h>
+#else
+#include <winsock.h>
+#include <windows.h>
+#endif
+
#include <sys/types.h>
+
+#ifndef _WIN32
#include <sys/time.h>
-#include <fcntl.h>
-#include <ctype.h>
+#endif
#ifdef _AIX
extern int strcasecmp(const char *, const char *);
@@ -49,6 +67,11 @@ extern int connect(int, struct sockaddr *, int);
# endif
#endif /* _AIX */
+#ifdef _WIN32
+#define PATH_MAX MAX_PATH
+#define snprintf _snprintf
+#endif
+
/*************************************************************************/