Browse Source

Compile on win32

svn:r4496
Nick Mathewson 20 years ago
parent
commit
806da0d8b2
4 changed files with 24 additions and 22 deletions
  1. 4 2
      src/common/compat.c
  2. 1 1
      src/or/control.c
  3. 0 19
      src/or/main.c
  4. 19 0
      src/or/or.h

+ 4 - 2
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.
  * Requires that nlen be greater than zero.
  */
  */
 const void *
 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)
 #if defined(HAVE_MEMMEM) && (!defined(__GNUC__) || __GNUC__ >= 2)
   tor_assert(nlen);
   tor_assert(nlen);
   return memmem(haystack, hlen, needle, nlen);
   return memmem(haystack, hlen, needle, nlen);
 #else
 #else
   /* This isn't as fast as the GLIBC implementation, but it doesn't need to be. */
   /* 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;
   char first;
   tor_assert(nlen);
   tor_assert(nlen);
 
 

+ 1 - 1
src/or/control.c

@@ -270,7 +270,7 @@ write_escaped_data(const char *data, size_t len, int translate_newlines,
   const char *end;
   const char *end;
   int i;
   int i;
   int start_of_line;
   int start_of_line;
-  for (i=0; i<len; ++i) {
+  for (i=0; i<(int)len; ++i) {
     if (data[i]== '\n')
     if (data[i]== '\n')
       ++sz_out;
       ++sz_out;
   }
   }

+ 0 - 19
src/or/main.c

@@ -16,25 +16,6 @@ const char main_c_id[] = "$Id$";
 #include <dmalloc.h>
 #include <dmalloc.h>
 #endif
 #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 **********/
 /********* PROTOTYPES **********/
 
 
 static void dumpmemusage(int severity);
 static void dumpmemusage(int severity);

+ 19 - 0
src/or/or.h

@@ -139,6 +139,25 @@
 #include "../common/util.h"
 #include "../common/util.h"
 #include "../common/torgzip.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)
 #if (SIZEOF_CELL_T != 0)
 /* On Irix, stdlib.h defines a cell_t type, so we need to make sure
 /* On Irix, stdlib.h defines a cell_t type, so we need to make sure
  * that our stuff always calls cell_t something different. */
  * that our stuff always calls cell_t something different. */