diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-06-12 15:09:09 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-06-12 15:09:09 -0400 |
commit | 74bf885b2d280c3006018cf9256c2ca3781bfcf9 (patch) | |
tree | 04e1985afd0b3cd68d0a716576235d58d2438b14 /src/common | |
parent | 1e709c79d12b2366d4e1c1ea517e313cc29ee3cd (diff) | |
download | tor-74bf885b2d280c3006018cf9256c2ca3781bfcf9.tar.gz tor-74bf885b2d280c3006018cf9256c2ca3781bfcf9.zip |
Whitespace and osx fixes on libevent2 patch.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/compat_libevent.c | 24 | ||||
-rw-r--r-- | src/common/compat_libevent.h | 1 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c index d9843c9c3c..73308b4eab 100644 --- a/src/common/compat_libevent.c +++ b/src/common/compat_libevent.c @@ -36,6 +36,15 @@ */ typedef uint32_t le_version_t; +/* Macros: returns the number of a libevent version. */ +#define V(major, minor, patch) \ + (((major) << 24) | ((minor) << 16) | ((patch) << 8)) +#define V_OLD(major, minor, patch) \ + V((major), (minor), (patch)-'a'+1) + +#define LE_OLD V(0,0,0) +#define LE_OTHER V(0,0,99) + static le_version_t tor_get_libevent_version(const char **v_out); #ifdef HAVE_EVENT_SET_LOG_CALLBACK @@ -187,7 +196,6 @@ tor_libevent_get_base(void) return the_event_base; } - #ifndef HAVE_EVENT_BASE_LOOPEXIT /* Replacement for event_base_loopexit on some very old versions of Libevent that we are not yet brave enough to deprecate. */ @@ -212,15 +220,6 @@ tor_libevent_get_method(void) #endif } -/* Macros: returns the number of a libevent version. */ -#define V(major, minor, patch) \ - (((major) << 24) | ((minor) << 16) | ((patch) << 8)) -#define V_OLD(major, minor, patch) \ - V((major), (minor), (patch)-'a'+1) - -#define LE_OLD V(0,0,0) -#define LE_OTHER V(0,0,99) - /** Return the le_version_t for the current version of libevent. If the * version is very new, return LE_OTHER. If the version is so old that it * doesn't support event_get_version(), return LE_OLD. DOCDOC */ @@ -354,12 +353,12 @@ tor_check_libevent_version(const char *m, int server, /* Libevent versions before 1.3b do very badly on operating systems with * user-space threading implementations. */ #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) - if (server && version < V_OLD(1,3,'b')) + if (server && version < V_OLD(1,3,'b')) { thread_unsafe = 1; sad_os = "BSD variants"; } #elif defined(__APPLE__) || defined(__darwin__) - if (server && version < V_OLD(1,3,'b')) + if (server && version < V_OLD(1,3,'b')) { thread_unsafe = 1; sad_os = "Mac OS X"; } @@ -467,3 +466,4 @@ tor_check_libevent_header_compatibility(void) /* Your libevent is ancient. */ #endif } + diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h index b70f8d3083..d2e76ce4e2 100644 --- a/src/common/compat_libevent.h +++ b/src/common/compat_libevent.h @@ -51,3 +51,4 @@ void tor_check_libevent_header_compatibility(void); const char *tor_libevent_get_version_str(void); #endif + |