Browse Source

Fix windows build

svn:r2670
Nick Mathewson 21 years ago
parent
commit
b74b72a5ce
4 changed files with 9 additions and 5 deletions
  1. 1 1
      src/common/compat.c
  2. 4 0
      src/common/torgzip.c
  3. 3 3
      src/common/util.c
  4. 1 1
      src/or/config.c

+ 1 - 1
src/common/compat.c

@@ -8,6 +8,7 @@
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 
 
 #include "orconfig.h"
 #include "orconfig.h"
+#include "compat.h"
 
 
 #ifdef MS_WINDOWS
 #ifdef MS_WINDOWS
 #include <io.h>
 #include <io.h>
@@ -65,7 +66,6 @@
 #include <string.h>
 #include <string.h>
 #include <assert.h>
 #include <assert.h>
 
 
-#include "compat.h"
 #include "log.h"
 #include "log.h"
 #include "util.h"
 #include "util.h"
 
 

+ 4 - 0
src/common/torgzip.c

@@ -13,7 +13,11 @@
 #include <stdlib.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <assert.h>
 #include <assert.h>
+#ifdef MS_WINDOWS
+#include "..\..\contrib\zlib\zlib.h"
+#else
 #include <zlib.h>
 #include <zlib.h>
+#endif
 
 
 #include "util.h"
 #include "util.h"
 #include "log.h"
 #include "log.h"

+ 3 - 3
src/common/util.c

@@ -14,6 +14,9 @@
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 
 
 #include "orconfig.h"
 #include "orconfig.h"
+#include "util.h"
+#include "log.h"
+#include "crypto.h"
 
 
 /* XXXX probably some of these are unneeded. find out which. */
 /* XXXX probably some of these are unneeded. find out which. */
 #ifdef MS_WINDOWS
 #ifdef MS_WINDOWS
@@ -31,9 +34,6 @@
 #include <string.h>
 #include <string.h>
 #include <assert.h>
 #include <assert.h>
 
 
-#include "util.h"
-#include "log.h"
-#include "crypto.h"
 
 
 #ifdef HAVE_NETINET_IN_H
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #include <netinet/in.h>

+ 1 - 1
src/or/config.c

@@ -63,7 +63,7 @@ typedef struct config_var_t {
 } config_var_t;
 } config_var_t;
 
 
 /** Return the offset of <b>member</b> within the type <b>tp</b>, in bytes */
 /** Return the offset of <b>member</b> within the type <b>tp</b>, 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 <b>name</b> has type
 /** An entry for config_vars: "The option <b>name</b> has type
  * CONFIG_TYPE_<b>conftype</b>, and corresponds to
  * CONFIG_TYPE_<b>conftype</b>, and corresponds to
  * or_options_t.<b>member</b>"
  * or_options_t.<b>member</b>"