delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/08/03:49:49

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <413EB9D2.5030207@kmweg.de>
Date: Wed, 08 Sep 2004 09:50:42 +0200
From: Martin Haendler <Extern DOT Haendler AT kmweg DOT de>
Organization: Krauss-Maffei Wegmann GmbH & Co. KG
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114
MIME-Version: 1.0
To: "Gerrit @ cygwin" <cygwin AT cygwin DOT com>
Subject: Re: Ada: Text_Io.Get_Immediate() is blocking
References: <413DBF55 DOT 3050909 AT kmweg DOT de> <1055102949 DOT 20040907164450 AT familiehaase DOT de>
In-Reply-To: <1055102949.20040907164450@familiehaase.de>
X-OriginalArrivalTime: 08 Sep 2004 07:49:40.0522 (UTC) FILETIME=[6587A8A0:01C49578]
X-IsSubscribed: yes

Gerrit P. Haase wrote:

>Hallo Martin,
>
>Am Dienstag, 7. September 2004 um 16:01 schriebst du:
>
>  
>
>>Hi,
>>I'm working with ADA and Windows2000/Cygwin.
>>    
>>
>
>  
>
>>A call to Text_Io.Get_Immediate() should return even if there is no 
>>input waiting. I have no problems with Linux, but trying to shift 
>>Software to Windows brings me into trouble: If there is no input 
>>waiting, the call is blocking.
>>    
>>
>
>  
>
>>Here is a simple example:
>>(Save it as "keyboardtest.adb" and call "gnatmake keyboardtest".)
>>===================================================
>>with Text_Io;
>>procedure Keyboardtest is
>>    Char : Character := ' ';
>>    Key_Pressed : Boolean := False;
>>begin
>>    Text_Io.Get_Immediate(Char, Key_Pressed);
>>    if Key_Pressed then
>>        Text_Io.Put_Line("[" & Char & "]");
>>    end if;
>>end Keyboardtest;
>>===================================================
>>    
>>
>
>  
>
>>With Linux (gcc version 3.2.3, GNAT Pro 5.02a) this program terminates
>>immediately which is the correct behaviour. With Win2000/Cygwin it waits
>>until a key is pressed, prints out the key and then terminates.
>>    
>>
>
>  
>
>>"gcc -v" says:
>>Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
>>Configured with: /GCC/gcc-3.3.1-3/configure --with-gcc --with-gnu-ld
>>--with-gnu-as --prefix=/usr --exec-prefix=/u
>>sr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/sbin 
>>--mandir=/usr/share/man --infodir=/usr/share/info -
>>-enable-languages=c,ada,c++,f77,pascal,java,objc --enable-libgcj 
>>--enable-threads=posix --with-system-zlib --enab
>>le-nls --without-included-gettext --enable-interpreter 
>>--enable-sjlj-exceptions --disable-version-specific-runtim
>>e-libs --enable-shared --disable-win32-registry --enable-java-gc=boehm
>>--disable-hash-synchronization --verbose -
>>-target=i686-pc-cygwin --host=i686-pc-cygwin --build=i686-pc-cygwin
>>Thread model: posix
>>gcc version 3.3.1 (cygming special)
>>    
>>
>
>  
>
>>"gnat" says:
>>GNAT 3.3.1 (cygming special) Copyright 1996-2002 Free Software 
>>Foundation, Inc.
>>    
>>
>
>  
>
>>Do you know any solution or workaround? Thank you!!!
>>    
>>
>
>
>Please upgrade to gcc-3.3.3 or try the test release gcc-3.4
>(experimental button in setup.exe installer).
>
>
>Gerrit
>  
>


Okay, I updated to gcc-3.3.3 but nothing changed: 
Text_Io.Get_Immediate() is still blocking.
I'm a bit stuck as this function is the only way in ADA to get keyboard 
input nonblocking.

Thanks for further help!
Martin


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019