error.c: check if EWOULDBLOCK is defined

* error.c (set_syserr): EWOULDBLOCK may not be defined, check if
  defined first.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-10-20 06:58:16 +00:00
Родитель bd2d094aab
Коммит 8d9e1f9dad
1 изменённых файлов: 10 добавлений и 10 удалений

20
error.c
Просмотреть файл

@ -1290,19 +1290,19 @@ set_syserr(int n, const char *name)
/* capture nonblock errnos for WaitReadable/WaitWritable subclasses */
switch (n) {
case EAGAIN:
rb_eEAGAIN = error;
case EAGAIN:
rb_eEAGAIN = error;
#if EAGAIN != EWOULDBLOCK
break;
case EWOULDBLOCK:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
break;
case EWOULDBLOCK:
#endif
rb_eEWOULDBLOCK = error;
break;
case EINPROGRESS:
rb_eEINPROGRESS = error;
break;
rb_eEWOULDBLOCK = error;
break;
case EINPROGRESS:
rb_eEINPROGRESS = error;
break;
}
rb_define_const(error, "Errno", INT2NUM(n));