diff --git a/ChangeLog b/ChangeLog index e0f690d2bc..fd9af09663 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Mar 10 03:00:43 2011 Tanaka Akira + + * ext/openssl/ossl_ssl.c: parenthesize macro arguments. + Wed Mar 9 23:51:26 2011 CHIKANAGA Tomoyuki * test/ruby/test_io_m17n.rb (test_io_new_enc): "sjis" is now an alias diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index e26be8a365..e5cce0f0e8 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -16,12 +16,12 @@ # include /* for read(), and write() */ #endif -#define numberof(ary) (int)(sizeof(ary)/sizeof(ary[0])) +#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0])) #ifdef _WIN32 # define TO_SOCKET(s) _get_osfhandle(s) #else -# define TO_SOCKET(s) s +# define TO_SOCKET(s) (s) #endif VALUE mSSL; @@ -1064,9 +1064,9 @@ ossl_ssl_setup(VALUE self) } #ifdef _WIN32 -#define ssl_get_error(ssl, ret) (errno = rb_w32_map_errno(WSAGetLastError()), SSL_get_error(ssl, ret)) +#define ssl_get_error(ssl, ret) (errno = rb_w32_map_errno(WSAGetLastError()), SSL_get_error((ssl), (ret))) #else -#define ssl_get_error(ssl, ret) SSL_get_error(ssl, ret) +#define ssl_get_error(ssl, ret) SSL_get_error((ssl), (ret)) #endif static void