[or-cvs] [tor/master 4/5] moved wince related includes and defs to compat.h where possible, removed unused/redundant wince includes

nickm at torproject.org nickm at torproject.org
Mon May 24 16:20:37 UTC 2010


Author: valerino <valerino at te4i.com>
Date: Sat, 22 May 2010 03:02:32 +0200
Subject: moved wince related includes and defs to compat.h where possible, removed unused/redundant wince includes
Commit: 076063ca90cc784363127e24a83e38bd54b0e003

---
 src/common/compat.c  |    2 --
 src/common/compat.h  |   16 ++++++++++++++++
 src/common/tortls.c  |    4 ++++
 src/or/main.c        |    4 ----
 src/win32/orconfig.h |    9 ++++++++-
 5 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/src/common/compat.c b/src/common/compat.c
index f93a161..066623b 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -22,10 +22,8 @@
 #ifdef MS_WINDOWS
 #include <process.h>
 #include <windows.h>
-#if !defined (WINCE)
 #include <sys/locking.h>
 #endif
-#endif
 
 #ifdef HAVE_UNAME
 #include <sys/utsname.h>
diff --git a/src/common/compat.h b/src/common/compat.h
index 077256e..7d59501 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -51,6 +51,22 @@
 #include <netinet6/in6.h>
 #endif
 
+#if defined (WINCE)
+#include <fcntl.h>
+#include <io.h>
+#include <math.h>
+#include <projects.h>
+#define snprintf _snprintf
+/* this is not exported as W .... */
+#define SHGetPathFromIDListW SHGetPathFromIDList
+/* wcecompat has vasprintf */
+#define HAVE_VASPRINTF
+/* no service here */
+#ifdef NT_SERVICE
+#undef NT_SERVICE
+#endif
+#endif // WINCE
+
 #ifndef NULL_REP_IS_ZERO_BYTES
 #error "It seems your platform does not represent NULL as zero. We can't cope."
 #endif
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 218f110..6732d55 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -16,6 +16,10 @@
 
 #include "orconfig.h"
 
+#if defined (WINCE)
+#include <WinSock2.h>
+#endif
+
 #include <assert.h>
 #include <openssl/ssl.h>
 #include <openssl/ssl3.h>
diff --git a/src/or/main.c b/src/or/main.c
index 5423835..0c3e6d5 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -24,10 +24,6 @@
 #include <event.h>
 #endif
 
-#if defined (WINCE)
-#include <projects.h>
-#endif
-
 void evdns_shutdown(int);
 
 /********* PROTOTYPES **********/
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 4915597..0a9ecfd 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -88,11 +88,18 @@
 #define HAVE_STRING_H
 
 /* Define to 1 if you have the `strlcat' function. */
+#if defined (WINCE)
+#define HAVE_STRLCAT
+#else
 #undef HAVE_STRLCAT
+#endif
 
 /* Define to 1 if you have the `strlcpy' function. */
+#if defined (WINCE)
+#define HAVE_STRLCPY
+#else
 #undef HAVE_STRLCPY
-
+#endif
 /* Define to 1 if you have the `strptime' function. */
 #undef HAVE_STRPTIME
 
-- 
1.6.5




More information about the tor-commits mailing list