[evolution-data-server] [win32] Trying to remove inclusion of win32 headers in camel headers. Following the new include poli
- From: Fridrich Strba <strba src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] [win32] Trying to remove inclusion of win32 headers in camel headers. Following the new include poli
- Date: Tue, 6 Apr 2010 14:59:21 +0000 (UTC)
commit 354a933ec6412cadc1a3f8ac3e45509ec025711d
Author: Fridrich Å trba <fridrich strba bluewin ch>
Date: Tue Apr 6 16:31:16 2010 +0200
[win32] Trying to remove inclusion of win32 headers in camel headers.
Following the new include policy of camel/camel.h, windows defines were
poluting everything. Trying to make them unseen and unheard of.
camel/camel-http-stream.c | 5 +++++
camel/camel-mime-utils.c | 5 +++++
camel/camel-net-utils.c | 2 ++
camel/camel-net-utils.h | 11 +++++++----
camel/camel-sasl-digest-md5.c | 5 +++++
camel/camel-tcp-stream-raw.c | 2 ++
camel/camel-tcp-stream-ssl.c | 5 +++++
camel/camel-tcp-stream.c | 5 +++++
camel/camel-tcp-stream.h | 14 +++++++++++---
camel/providers/groupwise/camel-groupwise-store.c | 5 +++++
camel/providers/imap/camel-imap-store.c | 5 +++++
camel/providers/imapx/camel-imapx-server.c | 5 +++++
camel/providers/nntp/camel-nntp-store.c | 5 +++++
camel/providers/pop3/camel-pop3-store.c | 5 +++++
camel/providers/smtp/camel-smtp-provider.c | 5 +++++
camel/providers/smtp/camel-smtp-transport.c | 5 +++++
camel/providers/smtp/camel-smtp-transport.h | 8 ++++++++
17 files changed, 90 insertions(+), 7 deletions(-)
---
diff --git a/camel/camel-http-stream.c b/camel/camel-http-stream.c
index cbab535..456e9a1 100644
--- a/camel/camel-http-stream.c
+++ b/camel/camel-http-stream.c
@@ -43,6 +43,11 @@
#include "camel-tcp-stream-ssl.h"
#endif
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define d(x)
static CamelStreamClass *parent_class = NULL;
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 0f15a40..fe71c83 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -50,6 +50,11 @@
#include "camel-iconv.h"
#include "camel-mime-utils.h"
#include "camel-net-utils.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include "camel-net-utils-win32.h"
+#endif
#include "camel-utf8.h"
#ifdef G_OS_WIN32
diff --git a/camel/camel-net-utils.c b/camel/camel-net-utils.c
index 3ca1ae1..e77c5dd 100644
--- a/camel/camel-net-utils.c
+++ b/camel/camel-net-utils.c
@@ -35,6 +35,8 @@
#include "camel-msgport.h"
#include "camel-net-utils.h"
#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
#include "camel-net-utils-win32.h"
#endif
#include "camel-operation.h"
diff --git a/camel/camel-net-utils.h b/camel/camel-net-utils.h
index 85e2469..37210be 100644
--- a/camel/camel-net-utils.h
+++ b/camel/camel-net-utils.h
@@ -33,10 +33,9 @@
#include <sys/socket.h>
#include <netdb.h>
#else
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#undef WIN32_LEAN_AND_MEAN
-#include <ws2tcpip.h>
+#define socklen_t int
+struct sockaddr;
+struct addrinfo;
#endif
G_BEGIN_DECLS
@@ -99,4 +98,8 @@ gint camel_getnameinfo(const struct sockaddr *sa, socklen_t salen, gchar **host,
G_END_DECLS
+#ifdef _WIN32
+#undef socklen_t
+#endif
+
#endif /* CAMEL_NET_UTILS_H */
diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c
index cb2cd7f..99e03c4 100644
--- a/camel/camel-sasl-digest-md5.c
+++ b/camel/camel-sasl-digest-md5.c
@@ -36,6 +36,11 @@
#include "camel-iconv.h"
#include "camel-mime-utils.h"
#include "camel-net-utils.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include "camel-net-utils-win32.h"
+#endif
#include "camel-sasl-digest-md5.h"
#define d(x)
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 72979e7..177f95d 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -42,6 +42,8 @@
#define SOCKET_ERROR_IS_EINPROGRESS() (errno == EINPROGRESS)
#define SOCKET_ERROR_IS_EINTR() (errno == EINTR)
#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
#define SOCKET_ERROR_CODE() WSAGetLastError ()
#define SOCKET_CLOSE(fd) closesocket (fd)
#define SOCKET_ERROR_IS_EINPROGRESS() (WSAGetLastError () == WSAEWOULDBLOCK)
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 62290c4..f80f9f9 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -61,6 +61,11 @@
#include "camel-stream-fs.h"
#include "camel-tcp-stream-ssl.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define IO_TIMEOUT (PR_TicksPerSecond() * 4 * 60)
#define CONNECT_TIMEOUT (PR_TicksPerSecond () * 4 * 60)
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
index 9584806..1575af6 100644
--- a/camel/camel-tcp-stream.c
+++ b/camel/camel-tcp-stream.c
@@ -28,6 +28,11 @@
#include "camel-tcp-stream.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define w(x)
static CamelStreamClass *parent_class = NULL;
diff --git a/camel/camel-tcp-stream.h b/camel/camel-tcp-stream.h
index 6838bc6..f5468ab 100644
--- a/camel/camel-tcp-stream.h
+++ b/camel/camel-tcp-stream.h
@@ -35,9 +35,14 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
+typedef struct linger CamelLinger;
#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
+typedef struct {
+ unsigned short l_onoff;
+ unsigned short l_linger;
+} CamelLinger;
+#define socklen_t int
+struct addrinfo;
#endif
#include <unistd.h>
@@ -74,7 +79,6 @@ typedef enum {
CAMEL_SOCKOPT_LAST
} CamelSockOpt;
-typedef struct linger CamelLinger;
typedef struct _CamelSockOptData {
CamelSockOpt option;
@@ -134,4 +138,8 @@ struct sockaddr *
G_END_DECLS
+#ifdef G_OS_WIN32
+#undef socklen_t
+#endif
+
#endif /* CAMEL_TCP_STREAM_H */
diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c
index 767a10f..f502352 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -46,6 +46,11 @@
#include "camel-groupwise-summary.h"
#include "camel-groupwise-utils.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define d(x)
#define CURSOR_ITEM_LIMIT 100
#define JUNK_ENABLE 1
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 289b395..90b48ac 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -46,6 +46,11 @@
#include "camel-imap-summary.h"
#include "camel-imap-utils.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define d(x)
/* Specified in RFC 2060 */
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index f92ab9e..c51a717 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -29,6 +29,11 @@
#include "camel-imapx-store.h"
#include "camel-imapx-summary.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define c(x)
#define e(x)
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index d956ace..e5e4b66 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -43,6 +43,11 @@
#include "camel-nntp-private.h"
#include "camel-nntp-resp-codes.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define w(x)
#define dd(x) (camel_debug("nntp")?(x):0)
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index f91cca2..424757d 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -40,6 +40,11 @@
#include "camel-pop3-folder.h"
#include "camel-pop3-store.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
/* Specified in RFC 1939 */
#define POP3_PORT "110"
#define POP3S_PORT "995"
diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c
index 0136828..e611711 100644
--- a/camel/providers/smtp/camel-smtp-provider.c
+++ b/camel/providers/smtp/camel-smtp-provider.c
@@ -30,6 +30,11 @@
#include "camel-smtp-transport.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
static guint smtp_url_hash (gconstpointer key);
static gint smtp_url_equal (gconstpointer a, gconstpointer b);
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index cde18f4..cc18553 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -40,6 +40,11 @@
#include "camel-smtp-transport.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#undef MIN
#undef MAX
diff --git a/camel/providers/smtp/camel-smtp-transport.h b/camel/providers/smtp/camel-smtp-transport.h
index 318b4c7..5dc19a0 100644
--- a/camel/providers/smtp/camel-smtp-transport.h
+++ b/camel/providers/smtp/camel-smtp-transport.h
@@ -39,6 +39,10 @@
#define CAMEL_SMTP_TRANSPORT_AUTH_EQUAL (1 << 4) /* set if we are using authtypes from a broken AUTH= */
+#ifdef G_OS_WIN32
+#define socklen_t int
+#endif
+
G_BEGIN_DECLS
typedef struct {
@@ -65,4 +69,8 @@ CamelType camel_smtp_transport_get_type (void);
G_END_DECLS
+#ifdef G_OS_WIN32
+#undef socklen_t
+#endif
+
#endif /* CAMEL_SMTP_TRANSPORT_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]