summaryrefslogtreecommitdiff
path: root/ext/socket/option.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-26 10:38:44 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-26 10:38:44 +0000
commit6446be302b27e8ea203c9048de51a4d7757f2d4f (patch)
tree09dd684cfc44d4f5ce6a4f359f4928cb02142a5e /ext/socket/option.c
parentbcd39a085110ffef93aef848f70dc68c12b62ca2 (diff)
* ext/socket/option.c: define IFNAMSIZ if not available.
fix compilation error on mingw32. reported by nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/option.c')
-rw-r--r--ext/socket/option.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 96cc8b4..fec8277 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -465,6 +465,9 @@ rb_if_indextoname(const char *succ_prefix, const char *fail_prefix, unsigned int
else
return snprintf(buf, len, "%s%s", succ_prefix, ifbuf);
#else
+# ifndef IFNAMSIZ
+# define IFNAMSIZ (sizeof(unsigned int)*3+1)
+# endif
return snprintf(buf, len, "%s%u", fail_prefix, ifindex);
#endif
}