From e1461461ccfc66d37bbc4823d44bb9e2b7d879ae Mon Sep 17 00:00:00 2001 From: eban Date: Mon, 18 Sep 2000 09:54:47 +0000 Subject: eban git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index 2bf1bb1dbc..f8de990bad 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1558,11 +1558,15 @@ EXTERN_C void __cdecl _lock_fhandle(int); EXTERN_C void __cdecl _unlock_fhandle(int); EXTERN_C void __cdecl _unlock(int); +#if defined _MT || defined __MSVCRT__ +#define MSVCRT_THREADS +#endif + typedef struct { long osfhnd; /* underlying OS file HANDLE */ char osfile; /* attributes of file (e.g., open in text mode?) */ char pipech; /* one char buffer for handles opened on pipes */ -#ifdef _MT +#ifdef MSVCRT_THREADS int lockinitflag; CRITICAL_SECTION lock; #endif @@ -1598,7 +1602,7 @@ _alloc_osfhnd(void) CloseHandle(hF); if (fh == -1) return fh; -#ifdef _MT +#ifdef MSVCRT_THREADS EnterCriticalSection(&(_pioinfo(fh)->lock)); #endif return fh; @@ -1635,7 +1639,7 @@ my_open_osfhandle(long osfhandle, int flags) fileflags |= FOPEN; /* mark as open */ _osfile(fh) = fileflags; /* set osfile entry */ -#ifdef _MT +#ifdef MSVCRT_THREADS LeaveCriticalSection(&_pioinfo(fh)->lock); #endif -- cgit v1.2.3