aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-28 20:13:21 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-28 20:13:21 +0000
commit7055f837abeca974d3b73ed26b6d26898daa9e89 (patch)
treec087acf0452d4da39409c5e68f67c06e7da17d1d /src/common/util.h
parentca8d50abeb260898a6657a06423667479a621a22 (diff)
downloadtor-7055f837abeca974d3b73ed26b6d26898daa9e89.tar.gz
tor-7055f837abeca974d3b73ed26b6d26898daa9e89.zip
Make Tor build on win32 with VC6 without warnings.
svn:r1739
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/common/util.h b/src/common/util.h
index bd65a0153b..dcfe7a94dc 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -36,8 +36,14 @@
#define strncasecmp strnicmp
#define strcasecmp stricmp
#define INLINE __inline
+#define _ARRAYSIZE(x) (((x)==0)?1:0)
+/* Windows compilers before VC7 don't have __FUNCTION__. */
+#if _MSC_VER < 1300
+#define __FUNCTION__ "???"
+#endif
#else
#define INLINE inline
+#define _ARRAYSIZE(x) (x)
#endif
#ifdef NDEBUG
@@ -76,8 +82,8 @@ void tor_strlower(char *s);
#define set_uint32(cp,v) do { *(uint32_t*)(cp) = (v); } while (0)
#else
#if 1
-uint16_t get_uint16(char *cp);
-uint32_t get_uint32(char *cp);
+uint16_t get_uint16(const char *cp);
+uint32_t get_uint32(const char *cp);
void set_uint16(char *cp, uint16_t v);
void set_uint32(char *cp, uint32_t v);
#else