diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-05-23 08:23:03 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-05-23 08:23:03 +0000 |
commit | 89a8411acec388612c71a0268752cbc0d5f958d4 (patch) | |
tree | 7ba1d7f7abdf839299a203eefd00a1a312cd7866 /src/common/compat.h | |
parent | 13c4590dd19351f55e8eb6830e44d64897b72c73 (diff) | |
download | tor-89a8411acec388612c71a0268752cbc0d5f958d4.tar.gz tor-89a8411acec388612c71a0268752cbc0d5f958d4.zip |
Throw out this UNALIGNED_INT_ACCESS_OK nonsense. Even where it works, it is often way way slower than doing the right thing. Backport candidate.
svn:r6473
Diffstat (limited to 'src/common/compat.h')
-rw-r--r-- | src/common/compat.h | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index 8e570cb269..25876ef18d 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -223,21 +223,10 @@ const char *tor_socket_strerror(int e); /* ===== OS compatibility */ const char *get_uname(void); -/* Some platforms segfault when you try to access a multi-byte type - * that isn't aligned to a word boundary. The macros and/or functions - * below can be used to access unaligned data on any platform. - */ -#ifdef UNALIGNED_INT_ACCESS_OK -#define get_uint16(cp) (*(uint16_t*)(cp)) -#define get_uint32(cp) (*(uint32_t*)(cp)) -#define set_uint16(cp,v) do { *(uint16_t*)(cp) = (v); } while (0) -#define set_uint32(cp,v) do { *(uint32_t*)(cp) = (v); } while (0) -#else 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); -#endif int set_max_file_descriptors(unsigned long limit, unsigned long cap); int switch_id(char *user, char *group); |