From 738819cdce8e966e04a3e83d305db2cfa9bdaa75 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 15 Feb 2006 10:32:35 +0100 Subject: s-parame-mingw.adb, [...]: Removed, replaced by s-parame.adb * s-parame-mingw.adb, s-parame-linux.adb, s-parame-solaris.adb: Removed, replaced by s-parame.adb * s-parame-vxworks.ads: Fix typo. * s-parame-vxworks.adb: New file. * s-parame.adb: Version now used by all native platforms. (Default_Stack_Size): Use 2 megs for default stack size and use __gl_default_stack_size when available. (Minimum_Stack_Size): Use 12K. * s-taprop-mingw.adb: Set default stack size linker switch to 2megs. (Create_Task): Refine implementation taking advantage of the XP stack size support. On XP, we now create the thread using the flag STACK_SIZE_PARAM_IS_A_RESERVATION. * s-osinte-mingw.ads (Stack_Size_Param_Is_A_Reservation): New constant. * sysdep.c (__gnat_is_windows_xp): New routine, returns 1 on Windows XP and 0 on older Windows versions. * interfac-vms.ads: Removed, no longer used. From-SVN: r111034 --- gcc/ada/sysdep.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'gcc/ada/sysdep.c') diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 03818b1..376a365 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2005 Free Software Foundation, Inc. * + * Copyright (C) 1992-2006, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -212,6 +212,8 @@ static void winflush_95 (void); static void winflush_nt (void); +int __gnat_is_windows_xp (void); + /* winflusfunction is set first to the winflushinit function which will check the OS version 95/98 or NT/2000 */ @@ -234,15 +236,40 @@ winflush_init (void) } -static void winflush_95 (void) +static void +winflush_95 (void) { FlushConsoleInputBuffer (GetStdHandle (STD_INPUT_HANDLE)); } -static void winflush_nt (void) +static void +winflush_nt (void) { /* Does nothing as there is no problem under NT. */ } + +int +__gnat_is_windows_xp (void) +{ + static int is_win_xp=0, is_win_xp_checked=0; + + if (!is_win_xp_checked) + { + OSVERSIONINFO version; + + is_win_xp_checked = 1; + + memset (&version, 0, sizeof (version)); + version.dwOSVersionInfoSize = sizeof (version); + + is_win_xp = GetVersionEx (&version) + && version.dwPlatformId == VER_PLATFORM_WIN32_NT + && (version.dwMajorVersion > 5 + || (version.dwMajorVersion == 5 && version.dwMinorVersion >= 1)); + } + return is_win_xp; +} + #endif #else -- cgit v1.1