diff --git a/ChangeLog b/ChangeLog index 0de1edbdf3..8551aa2f00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Jan 1 20:17:47 2009 Tanaka Akira + + * ext/socket/socket.c: include constants.h at top. + Thu Jan 1 19:53:33 2009 Tanaka Akira * ext/socket/mkconstants.rb: add valp argument for family_to_int and diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 90ce5af347..6561c89b98 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -130,6 +130,14 @@ struct sockaddr_storage { }; #endif +static void sock_define_const(const char *name, int value, VALUE mConst); +static void sock_define_uconst(const char *name, unsigned int value, VALUE mConst); +#define sock_define_const(name, value) sock_define_const(name, value, mConst) +#define sock_define_uconst(name, value) sock_define_uconst(name, value, mConst) +#include "constants.h" +#undef sock_define_const +#undef sock_define_uconst + #if defined(INET6) && (defined(LOOKUP_ORDER_HACK_INET) || defined(LOOKUP_ORDER_HACK_INET6)) #define LOOKUP_ORDERS (sizeof(lookup_order_table) / sizeof(lookup_order_table[0])) static const int lookup_order_table[] = { @@ -981,8 +989,6 @@ sock_addrinfo(VALUE host, VALUE port, int socktype, int flags) return sock_getaddrinfo(host, port, &hints); } -static char *family_to_str(int val); - static VALUE ipaddr(struct sockaddr *sockaddr, int norevlookup) { @@ -2264,9 +2270,6 @@ unix_peeraddr(VALUE sock) } #endif -static int family_to_int(char *str, int len, int *valp); -static int socktype_to_int(char *str, int len, int *valp); - static void setup_domain_and_type(VALUE domain, int *dv, VALUE type, int *tv) { @@ -3516,11 +3519,6 @@ sock_define_uconst(const char *name, unsigned int value, VALUE mConst) rb_define_const(mConst, name, UINT2NUM(value)); } -#define sock_define_const(name, value) sock_define_const(name, value, mConst) -#define sock_define_uconst(name, value) sock_define_uconst(name, value, mConst) - -#include "constants.h" - /* * Class +Socket+ provides access to the underlying operating system * socket implementations. It can be used to provide more operating system