зеркало из https://github.com/github/ruby.git
* win32/win32.c (_pioinfo): make an inline function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a0ef626241
Коммит
083b923ea8
|
@ -1,3 +1,7 @@
|
|||
Tue Nov 22 17:49:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (_pioinfo): make an inline function.
|
||||
|
||||
Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
|
|
@ -2159,7 +2159,6 @@ EXTERN_C _CRTIMP ioinfo * __pioinfo[];
|
|||
|
||||
#define IOINFO_L2E 5
|
||||
#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
|
||||
#define _pioinfo(i) ((ioinfo*)((char*)(__pioinfo[i >> IOINFO_L2E]) + (i & (IOINFO_ARRAY_ELTS - 1)) * (sizeof(ioinfo) + pioinfo_extra)))
|
||||
#define _osfhnd(i) (_pioinfo(i)->osfhnd)
|
||||
#define _osfile(i) (_pioinfo(i)->osfile)
|
||||
#define _pipech(i) (_pioinfo(i)->pipech)
|
||||
|
@ -2190,6 +2189,14 @@ set_pioinfo_extra(void)
|
|||
#define pioinfo_extra 0
|
||||
#endif
|
||||
|
||||
static inline ioinfo*
|
||||
_pioinfo(int fd)
|
||||
{
|
||||
const size_t sizeof_ioinfo = sizeof(ioinfo) + pioinfo_extra;
|
||||
return (ioinfo*)((char*)__pioinfo[fd >> IOINFO_L2E] +
|
||||
(fd & (IOINFO_ARRAY_ELTS - 1)) * sizeof_ioinfo);
|
||||
}
|
||||
|
||||
#define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh)
|
||||
#define _set_osflags(fh, flags) (_osfile(fh) = (flags))
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче