summaryrefslogtreecommitdiffstats
path: root/winsup
diff options
context:
space:
mode:
Diffstat (limited to 'winsup')
-rw-r--r--winsup/mingw/ChangeLog6
-rw-r--r--winsup/mingw/mingwex/mingw-fseek.c35
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 <dannysmith@users.sourceforge.net>
+
+ * 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 <dannysmith@users.sourceforge.net>
* 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 <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;