From b74b72a5ce9dc347e66f786f2be5240945e0d461 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 4 Nov 2004 04:01:19 +0000 Subject: [PATCH] Fix windows build svn:r2670 --- src/common/compat.c | 2 +- src/common/torgzip.c | 4 ++++ src/common/util.c | 6 +++--- src/or/config.c | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/common/compat.c b/src/common/compat.c index 6ce26afc41..7ecc6d9b4d 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -8,6 +8,7 @@ #define _GNU_SOURCE #include "orconfig.h" +#include "compat.h" #ifdef MS_WINDOWS #include @@ -65,7 +66,6 @@ #include #include -#include "compat.h" #include "log.h" #include "util.h" diff --git a/src/common/torgzip.c b/src/common/torgzip.c index 660ab0e05f..0491d87d14 100644 --- a/src/common/torgzip.c +++ b/src/common/torgzip.c @@ -13,7 +13,11 @@ #include #include #include +#ifdef MS_WINDOWS +#include "..\..\contrib\zlib\zlib.h" +#else #include +#endif #include "util.h" #include "log.h" diff --git a/src/common/util.c b/src/common/util.c index dc5f29bbaa..76b7254cd3 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -14,6 +14,9 @@ #define _GNU_SOURCE #include "orconfig.h" +#include "util.h" +#include "log.h" +#include "crypto.h" /* XXXX probably some of these are unneeded. find out which. */ #ifdef MS_WINDOWS @@ -31,9 +34,6 @@ #include #include -#include "util.h" -#include "log.h" -#include "crypto.h" #ifdef HAVE_NETINET_IN_H #include diff --git a/src/or/config.c b/src/or/config.c index ce9ed2e1cb..cd0a9a4a76 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -63,7 +63,7 @@ typedef struct config_var_t { } config_var_t; /** Return the offset of member within the type tp, in bytes */ -#define STRUCT_OFFSET(tp, member) ((off_t) &(((tp*)0)->member)) +#define STRUCT_OFFSET(tp, member) ((off_t) (((char*)&((tp*)0)->member)-(char*)0)) /** An entry for config_vars: "The option name has type * CONFIG_TYPE_conftype, and corresponds to * or_options_t.member" -- 2.47.3