aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-06-27 23:35:04 +0000
committerNick Mathewson <nickm@torproject.org>2005-06-27 23:35:04 +0000
commit806da0d8b2584fe741847d3b6f4cb4266c6a9080 (patch)
tree4de9c9befb721ee5b85b0f45e44cc1ffc7c76ca7
parent30571317dda56a83eeb077af5f1fefc61c7d3c9c (diff)
downloadtor-806da0d8b2584fe741847d3b6f4cb4266c6a9080.tar.gz
tor-806da0d8b2584fe741847d3b6f4cb4266c6a9080.zip
Compile on win32
svn:r4496
-rw-r--r--src/common/compat.c6
-rw-r--r--src/or/control.c2
-rw-r--r--src/or/main.c19
-rw-r--r--src/or/or.h19
4 files changed, 24 insertions, 22 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 7f0823bbe1..d2abc2af50 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -143,14 +143,16 @@ tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
* Requires that nlen be greater than zero.
*/
const void *
-tor_memmem(const void *haystack, size_t hlen, const void *needle, size_t nlen)
+tor_memmem(const void *_haystack, size_t hlen, const void *_needle, size_t nlen)
{
#if defined(HAVE_MEMMEM) && (!defined(__GNUC__) || __GNUC__ >= 2)
tor_assert(nlen);
return memmem(haystack, hlen, needle, nlen);
#else
/* This isn't as fast as the GLIBC implementation, but it doesn't need to be. */
- const void *p, *end;
+ const char *p, *end;
+ const char *haystack = (const char*)_haystack;
+ const char *needle = (const char*)_needle;
char first;
tor_assert(nlen);
diff --git a/src/or/control.c b/src/or/control.c
index 582f6e001e..752a6d4dec 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -270,7 +270,7 @@ write_escaped_data(const char *data, size_t len, int translate_newlines,
const char *end;
int i;
int start_of_line;
- for (i=0; i<len; ++i) {
+ for (i=0; i<(int)len; ++i) {
if (data[i]== '\n')
++sz_out;
}
diff --git a/src/or/main.c b/src/or/main.c
index a454fbebcf..c5d9406b07 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -16,25 +16,6 @@ const char main_c_id[] = "$Id$";
#include <dmalloc.h>
#endif
-/* These signals are defined to help control_signal_act work.
- * XXXX Move into or.h or compat.h
- */
-#ifndef SIGHUP
-#define SIGHUP 1
-#endif
-#ifndef SIGINT
-#define SIGINT 2
-#endif
-#ifndef SIGUSR1
-#define SIGUSR1 10
-#endif
-#ifndef SIGUSR2
-#define SIGUSR2 12
-#endif
-#ifndef SIGTERM
-#define SIGTERM 15
-#endif
-
/********* PROTOTYPES **********/
static void dumpmemusage(int severity);
diff --git a/src/or/or.h b/src/or/or.h
index 68d974e5f6..59ec3c9ed0 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -139,6 +139,25 @@
#include "../common/util.h"
#include "../common/torgzip.h"
+/* These signals are defined to help control_signal_act work.
+ * XXXX Move into compat.h ?
+ */
+#ifndef SIGHUP
+#define SIGHUP 1
+#endif
+#ifndef SIGINT
+#define SIGINT 2
+#endif
+#ifndef SIGUSR1
+#define SIGUSR1 10
+#endif
+#ifndef SIGUSR2
+#define SIGUSR2 12
+#endif
+#ifndef SIGTERM
+#define SIGTERM 15
+#endif
+
#if (SIZEOF_CELL_T != 0)
/* On Irix, stdlib.h defines a cell_t type, so we need to make sure
* that our stuff always calls cell_t something different. */