diff options
author | Björn-Egil Dahlberg <[email protected]> | 2011-06-30 16:26:42 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2011-06-30 16:26:42 +0200 |
commit | 7092c4a41ac0d38ae457c2dc768aa542337d8b8c (patch) | |
tree | 8875db1e685b9d9f5182a742b1ab07e5535348dd /lib/erl_interface/src/connect | |
parent | b467765e2bf4da509240a07968cfd5c51f615850 (diff) | |
parent | f24cff95a791e6798bd72e74d3967c962e1c9094 (diff) | |
download | otp-7092c4a41ac0d38ae457c2dc768aa542337d8b8c.tar.gz otp-7092c4a41ac0d38ae457c2dc768aa542337d8b8c.tar.bz2 otp-7092c4a41ac0d38ae457c2dc768aa542337d8b8c.zip |
Merge branch 'egil/ei-fix-buffer-alignment/OTP-9390' into dev
* egil/ei-fix-buffer-alignment/OTP-9390:
Align ei buffer according to size of pointers
Diffstat (limited to 'lib/erl_interface/src/connect')
-rw-r--r-- | lib/erl_interface/src/connect/ei_resolve.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/erl_interface/src/connect/ei_resolve.c b/lib/erl_interface/src/connect/ei_resolve.c index 50c5a4161d..ba8f8fbce3 100644 --- a/lib/erl_interface/src/connect/ei_resolve.c +++ b/lib/erl_interface/src/connect/ei_resolve.c @@ -185,7 +185,12 @@ static int verify_dns_configuration(void) * align: increment buf until it is dword-aligned, reduce len by same amount. * advance: increment buf by n bytes, reduce len by same amount . */ -#define align_buf(buf,len) for (;(((unsigned)buf)&0x3); (buf)++, len--) +#if defined SIZEOF_VOID_P +#define ALIGNBYTES (SIZEOF_VOID_P - 1) +#else +#define ALIGNBYTES (sizeof(void*) - 1) +#endif +#define align_buf(buf,len) for (;(((unsigned)buf) & ALIGNBYTES); (buf)++, len--) #define advance_buf(buf,len,n) ((buf)+=(n),(len)-=(n)) /* "and now the tricky part..." */ |