diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-06 14:14:30 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-06 14:14:30 +0200 |
commit | 08f8a983b9f683d14b2fa18a13b4b2fb33ea40b7 (patch) | |
tree | 1b96738a51d9c45e1f4cff05c2f0e3a0eee58e09 /gcc/ada/sysdep.c | |
parent | cb3d8731fd7316bcdeff478fbae3f54cc9757944 (diff) | |
download | gcc-08f8a983b9f683d14b2fa18a13b4b2fb33ea40b7.zip gcc-08f8a983b9f683d14b2fa18a13b4b2fb33ea40b7.tar.gz gcc-08f8a983b9f683d14b2fa18a13b4b2fb33ea40b7.tar.bz2 |
[multiple changes]
2011-09-06 Thomas Quinot <quinot@adacore.com>
* s-os_lib.ads (Spawn): Minor documentation clarification,
Success is True for a zero exit status.
2011-09-06 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb: Add message for common iterator error.
2011-09-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb (Build_Initialization_Call): If the target is a
selected component discriminated by a current instance, replace
the constraint with a reference to the target object, regardless
of whether the context is an init_proc.
2011-09-06 Robert Dewar <dewar@adacore.com>
* exp_attr.adb: Descriptor_Size is never static.
2011-09-06 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Add documentation for LSLOC metric in gnatmetric
2011-09-06 Hristian Kirtchev <kirtchev@adacore.com>
* gnat_rm.texi: Clarify that attribute Descriptor_Size is
non-static.
2011-09-06 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve): An expression that is the body of an
expression function does not freeze.
2011-09-06 Matthew Heaney <heaney@adacore.com>
* a-csquin.ads, a-cusyqu.adb, a-cbprqu.adb, a-cbsyqu.adb,
a-cuprqu.adb: Changed copyright notice to indicate current
year only.
2011-09-06 Vincent Celier <celier@adacore.com>
* prj.adb: Minor spelling error fix in comment
* sem_res.adb: Minor reformatting
2011-09-06 Pascal Obry <obry@adacore.com>
* sysdep.c (winflush_nt): Removed as not needed anymore.
(winflush_95): Likewise.
(winflush_init): Likewise.
(winflush_function): Likewise.
(getc_immediate_common): Remove call to winflush_function.
From-SVN: r178591
Diffstat (limited to 'gcc/ada/sysdep.c')
-rw-r--r-- | gcc/ada/sysdep.c | 80 |
1 files changed, 2 insertions, 78 deletions
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index af05a91..4d383fd 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -211,84 +211,10 @@ __gnat_ttyname (int filedes) return NULL; } -/* This function is needed to fix a bug under Win95/98. Under these platforms - doing : - ch1 = getch(); - ch2 = fgetc (stdin); - - will put the same character into ch1 and ch2. It seem that the character - read by getch() is not correctly removed from the buffer. Even a - fflush(stdin) does not fix the bug. This bug does not appear under Window - NT. So we have two version of this routine below one for 95/98 and one for - NT/2000 version of Windows. There is also a special routine (winflushinit) - that will be called only the first time to check which version of Windows - we are running running on to set the right routine to use. - - This problem occurs when using Text_IO.Get_Line after Text_IO.Get_Immediate - for example. - - Calling FlushConsoleInputBuffer just after getch() fix the bug under - 95/98. */ - -#ifdef RTX - -static void winflush_nt (void); - -/* winflush_function will do nothing since we only have problems with Windows - 95/98 which are not supported by RTX. */ - -static void (*winflush_function) (void) = winflush_nt; - -static void -winflush_nt (void) -{ - /* Does nothing as there is no problem under NT. */ -} - -#else /* !RTX */ - -static void winflush_init (void); - -static void winflush_95 (void); - -static void winflush_nt (void); +#ifndef RTX 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 */ - -static void (*winflush_function) (void) = winflush_init; - -/* This function does the runtime check of the OS version and then sets - winflush_function to the appropriate function and then call it. */ - -static void -winflush_init (void) -{ - DWORD dwVersion = GetVersion(); - - if (dwVersion < 0x80000000) /* Windows NT/2000 */ - winflush_function = winflush_nt; - else /* Windows 95/98 */ - winflush_function = winflush_95; - - (*winflush_function)(); /* Perform the 'flush' */ - -} - -static void -winflush_95 (void) -{ - FlushConsoleInputBuffer (GetStdHandle (STD_INPUT_HANDLE)); -} - -static void -winflush_nt (void) -{ - /* Does nothing as there is no problem under NT. */ -} - int __gnat_is_windows_xp (void) { @@ -311,7 +237,7 @@ __gnat_is_windows_xp (void) return is_win_xp; } -#endif /* !RTX */ +#endif /* Get the bounds of the stack. The stack pointer is supposed to be initialized to BASE when a thread is created and the stack can be extended @@ -542,7 +468,6 @@ getc_immediate_common (FILE *stream, if (waiting) { *ch = getch (); - (*winflush_function) (); if (*ch == eot_ch) *end_of_file = 1; @@ -559,7 +484,6 @@ getc_immediate_common (FILE *stream, { *avail = 1; *ch = getch (); - (*winflush_function) (); if (*ch == eot_ch) *end_of_file = 1; |