From 89a8411acec388612c71a0268752cbc0d5f958d4 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 23 May 2006 08:23:03 +0000 Subject: 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 --- src/common/compat.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/common/compat.h') 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); -- cgit v1.2.3-54-g00ecf