mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Compile on win32
svn:r4496
This commit is contained in:
parent
30571317dd
commit
806da0d8b2
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
19
src/or/or.h
19
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. */
|
||||
|
Loading…
Reference in New Issue
Block a user