Skip to content

Commit 19986c6

Browse files
committed
Fixed FILE structure size for OLDCRT + modern VC++
There was a problem with structure size alignment: it wasn't aligned to pointer size, what caused wrong stderr etc with 64-bit builds.
1 parent 6326781 commit 19986c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Core/CoreWin32.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ enum { CRT_FILE_SIZE = (sizeof(char*)*3 + sizeof(int)*5) };
548548

549549
extern "C" FILE* __cdecl __acrt_iob_func(unsigned Index)
550550
{
551-
return (FILE*)((char*)__iob_func() + Index * CRT_FILE_SIZE);
551+
return (FILE*)((char*)__iob_func() + Index * Align(CRT_FILE_SIZE, sizeof(char*)));
552552
}
553553

554554
#endif // OLDCRT

0 commit comments

Comments
 (0)