From 989c97fe141b5869c3dfd438683b14a8bc8453ca Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Sun, 26 Jan 2003 06:38:43 +0000 Subject: [PATCH] * mingwex/mingw-fseek.c (INLINE): Remove define. (__mingw_is_win9x): Remove static inline function. (_mingw_fwrite): Use _osver instead of __mingw_is_win9x. --- winsup/mingw/ChangeLog | 6 +++++ winsup/mingw/mingwex/mingw-fseek.c | 35 ++---------------------------- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 5f65876ec..25aa9c804 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,9 @@ +2003-01-26 Danny Smith + + * mingwex/mingw-fseek.c (INLINE): Remove define. + (__mingw_is_win9x): Remove static inline function. + (_mingw_fwrite): Use _osver instead of __mingw_is_win9x. + 2003-01-11 Danny Smith * mingwex/math/llround.c: Correct function name and diff --git a/winsup/mingw/mingwex/mingw-fseek.c b/winsup/mingw/mingwex/mingw-fseek.c index 6a3b66119..1ea011fa6 100644 --- a/winsup/mingw/mingwex/mingw-fseek.c +++ b/winsup/mingw/mingwex/mingw-fseek.c @@ -8,42 +8,11 @@ #include #include #include - -#ifdef __GNUC__ -# define INLINE __inline__ -#elif defined _MSC_VER -# define INLINE __inline -#else -# define INLINE -#endif +#include #define ZEROBLOCKSIZE 512 static int __mingw_fseek_called; -/* FIXME: put this in startup code and make os_platform_id global? - Or just get _osver from msvcrt.dll and bitest (_osver & 0x8000)? */ - -INLINE -static -int -__mingw_is_win9x (void) -{ - static DWORD os_platform_id = -1 ; - - if (os_platform_id == -1) - { - OSVERSIONINFO os_version_info; - memset (&os_version_info, 0, sizeof (OSVERSIONINFO)); - os_version_info.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - GetVersionEx (&os_version_info); - - os_platform_id = os_version_info.dwPlatformId; - } - - /* Don't even bother to check for Win32s. */ - return os_platform_id == VER_PLATFORM_WIN32_WINDOWS; -} - /* The fseek in Win9x runtime does not zero out the file if seeking past the end; if you don't want random stuff from your disk included in your output DLL/executable, use this version instead. On WinNT/Win2k, it @@ -64,7 +33,7 @@ int __mingw_fwrite (const void *buffer, size_t size, size_t count, FILE *fp) { # undef fwrite - if ( __mingw_is_win9x () && __mingw_fseek_called) + if ((_osver & 0x8000) && __mingw_fseek_called) { DWORD actual_length, current_position; __mingw_fseek_called = 0; -- 2.43.5