diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-01-26 09:38:43 +0300 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2003-01-26 09:38:43 +0300 |
commit | 989c97fe141b5869c3dfd438683b14a8bc8453ca (patch) | |
tree | dcab000724d05feaedf5ccb89c2ca97ef0161dcc /winsup/mingw/mingwex | |
parent | 5da947eacacdbc1905c2a6e051263e4a971b05ad (diff) |
* mingwex/mingw-fseek.c (INLINE): Remove define.
(__mingw_is_win9x): Remove static inline function.
(_mingw_fwrite): Use _osver instead of __mingw_is_win9x.
Diffstat (limited to 'winsup/mingw/mingwex')
-rw-r--r-- | winsup/mingw/mingwex/mingw-fseek.c | 35 |
1 files changed, 2 insertions, 33 deletions
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 <windows.h> #include <stdio.h> #include <io.h> - -#ifdef __GNUC__ -# define INLINE __inline__ -#elif defined _MSC_VER -# define INLINE __inline -#else -# define INLINE -#endif +#include <stdlib.h> #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; |