diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-06-27 23:35:04 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-06-27 23:35:04 +0000 |
commit | 806da0d8b2584fe741847d3b6f4cb4266c6a9080 (patch) | |
tree | 4de9c9befb721ee5b85b0f45e44cc1ffc7c76ca7 | |
parent | 30571317dda56a83eeb077af5f1fefc61c7d3c9c (diff) | |
download | tor-806da0d8b2584fe741847d3b6f4cb4266c6a9080.tar tor-806da0d8b2584fe741847d3b6f4cb4266c6a9080.tar.gz |
Compile on win32
svn:r4496
-rw-r--r-- | src/common/compat.c | 6 | ||||
-rw-r--r-- | src/or/control.c | 2 | ||||
-rw-r--r-- | src/or/main.c | 19 | ||||
-rw-r--r-- | src/or/or.h | 19 |
4 files changed, 24 insertions, 22 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 7f0823bbe..d2abc2af5 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 582f6e001..752a6d4de 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 a454fbebc..c5d9406b0 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 68d974e5f..59ec3c9ed 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. */ |