summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/cfgfiles.c4
-rw-r--r--src/common/chanopt.c4
-rw-r--r--src/common/dcc.c6
-rw-r--r--src/common/identd.c1
-rw-r--r--src/common/ignore.c4
-rw-r--r--src/common/inbound.c4
-rw-r--r--src/common/notify.c4
-rw-r--r--src/common/outbound.c2
-rw-r--r--src/common/proto-irc.c1
-rw-r--r--src/common/server.c9
-rw-r--r--src/common/ssl.c9
-rw-r--r--src/common/text.c4
-rw-r--r--src/common/util.c6
13 files changed, 43 insertions, 15 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 5116037c..c2e4ee1d 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -30,7 +30,9 @@
 #include "text.h"
 #include "xchatc.h"
 
-#ifndef WIN32
+#ifdef WIN32
+#include <io.h>
+#else
 #include <unistd.h>
 #define HEXCHAT_DIR "hexchat"
 #endif
diff --git a/src/common/chanopt.c b/src/common/chanopt.c
index 198ebe6c..8e8b0312 100644
--- a/src/common/chanopt.c
+++ b/src/common/chanopt.c
@@ -8,7 +8,9 @@
 #include <fcntl.h>
 #include <errno.h>
 
-#ifndef WIN32
+#ifdef WIN32
+#include <io.h>
+#else
 #include <unistd.h>
 #endif
 
diff --git a/src/common/dcc.c b/src/common/dcc.c
index 4c8724d9..18d4219b 100644
--- a/src/common/dcc.c
+++ b/src/common/dcc.c
@@ -40,6 +40,7 @@
 
 #ifdef WIN32
 #include <windows.h>
+#include <io.h>
 #else
 #include <unistd.h>
 #endif
@@ -803,7 +804,6 @@ static gboolean
 dcc_did_connect (GIOChannel *source, GIOCondition condition, struct DCC *dcc)
 {
 	int er;
-	struct sockaddr_in addr;
 	
 #ifdef WIN32
 	if (condition & G_IO_ERR)
@@ -822,6 +822,8 @@ dcc_did_connect (GIOChannel *source, GIOCondition condition, struct DCC *dcc)
 	}
 
 #else
+	struct sockaddr_in addr;
+
 	memset (&addr, 0, sizeof (addr));
 	addr.sin_port = htons (dcc->port);
 	addr.sin_family = AF_INET;
@@ -1980,7 +1982,9 @@ dcc_change_nick (struct server *serv, char *oldnick, char *newnick)
 static int
 is_same_file (struct DCC *dcc, struct DCC *new_dcc)
 {
+#ifndef WIN32
 	struct stat st_a, st_b;
+#endif
 
 	/* if it's the same filename, must be same */
 	if (strcmp (dcc->destfile, new_dcc->destfile) == 0)
diff --git a/src/common/identd.c b/src/common/identd.c
index 430c7e8f..ab1a7af4 100644
--- a/src/common/identd.c
+++ b/src/common/identd.c
@@ -3,6 +3,7 @@
 #include "inet.h"
 #include "xchat.h"
 #include "xchatc.h"
+#include "text.h"
 
 static int identd_is_running = FALSE;
 #ifdef USE_IPV6
diff --git a/src/common/ignore.c b/src/common/ignore.c
index 0ed23daa..cd0305e5 100644
--- a/src/common/ignore.c
+++ b/src/common/ignore.c
@@ -23,7 +23,9 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#ifndef WIN32
+#ifdef WIN32
+#include <io.h>
+#else
 #include <unistd.h>
 #endif
 
diff --git a/src/common/inbound.c b/src/common/inbound.c
index 89899655..ce04eaf8 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -23,7 +23,9 @@
 #include <sys/types.h>
 #include <time.h>
 
-#ifndef WIN32
+#ifdef WIN32
+#include <io.h>
+#else
 #include <unistd.h>
 #endif
 
diff --git a/src/common/notify.c b/src/common/notify.c
index 9c6e54de..2c6eb6db 100644
--- a/src/common/notify.c
+++ b/src/common/notify.c
@@ -24,7 +24,9 @@
 #include <fcntl.h>
 #include <time.h>
 
-#ifndef WIN32
+#ifdef WIN32
+#include <io.h>
+#else
 #include <unistd.h>
 #endif
 
diff --git a/src/common/outbound.c b/src/common/outbound.c
index a9d1e0c0..63653430 100644
--- a/src/common/outbound.c
+++ b/src/common/outbound.c
@@ -54,7 +54,7 @@
 #include "server.h"
 #include "tree.h"
 #include "outbound.h"
-
+#include "chanopt.h"
 
 #ifdef USE_DEBUG
 extern int current_mem_usage;
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index d8a6be7c..c1ca8af3 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -41,6 +41,7 @@
 #include "outbound.h"
 #include "util.h"
 #include "xchatc.h"
+#include "url.h"
 
 
 static void
diff --git a/src/common/server.c b/src/common/server.c
index c8cc59e0..2e8d535d 100644
--- a/src/common/server.c
+++ b/src/common/server.c
@@ -33,12 +33,13 @@
 #define WANTARPA
 #include "inet.h"
 
-#ifndef WIN32
+#ifdef WIN32
+#include <winbase.h>
+#include <io.h>
+#else
 #include <signal.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#else
-#include <winbase.h>
 #endif
 
 #include "xchat.h"
@@ -907,7 +908,9 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv)
 	char outbuf[512];
 	char host[100];
 	char ip[100];
+#ifdef USE_MSPROXY
 	char *p;
+#endif
 
 	waitline2 (source, tbuf, sizeof tbuf);
 
diff --git a/src/common/ssl.c b/src/common/ssl.c
index daa7416b..04fb6ac5 100644
--- a/src/common/ssl.c
+++ b/src/common/ssl.c
@@ -20,12 +20,17 @@
 #include "inet.h"				  /* make it first to avoid macro redefinitions */
 #include <openssl/ssl.h>		  /* SSL_() */
 #include <openssl/err.h>		  /* ERR_() */
-#include <time.h>					  /* asctime() */
+#ifdef WIN32
+#include <openssl/rand.h>		  /* RAND_seed() */
+#endif
+#include <time.h>				  /* asctime() */
 #include <string.h>				  /* strncpy() */
-#include "ssl.h"					  /* struct cert_info */
+#include "ssl.h"				  /* struct cert_info */
 #include "../../config.h"		  /* HAVE_SNPRINTF */
 
 #ifndef HAVE_SNPRINTF
+#include <glib.h>

+#include <glib/gprintf.h>
 #define snprintf g_snprintf
 #endif
 
diff --git a/src/common/text.c b/src/common/text.c
index f8f08767..133facd1 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -25,7 +25,9 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 
-#ifndef WIN32
+#ifdef WIN32
+#include <io.h>
+#else
 #include <unistd.h>
 #include <sys/mman.h>
 #endif
diff --git a/src/common/util.c b/src/common/util.c
index 74146b21..28352189 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1365,10 +1365,12 @@ int my_poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr) {
 int
 util_exec (const char *cmd)
 {
-	int pid;
 	char **argv;
 	int argc;
+#ifndef WIN32
+	int pid;
 	int fd;
+#endif
 
 	if (my_poptParseArgvString (cmd, &argc, &argv) != 0)
 		return -1;
@@ -1398,9 +1400,9 @@ util_exec (const char *cmd)
 int
 util_execv (char * const argv[])
 {
+#ifndef WIN32
 	int pid, fd;
 
-#ifndef WIN32
 	pid = fork ();
 	if (pid == -1)
 		return -1;