On Mon, 10 Nov 2008, Maurilio Longo wrote:

Hi Maurilio,

> It seems you did focus on mouse code, I've never dealt with it, but I'd say it
> has to do with openwatcom, because with GCC mttest*.* work ok.

To be precise the problem is with any console input and it's inside pure
OS2 API functions. It means that we probably using them in wrong way.
It may works for GCC because it may use some wrappers which resolve the
problem or hide it. I would be good to find what exactly it does because
it's a risk that the problem will be exploited also in some GCC builds.
First we should check keyboard input and disable mouse code. It should
give some answers which probably will also help to resolve problem with
mouse. We can easy disable mouse code for tests by removing:
   if( ch == 0 )
      ch = HB_GTSELF_MOUSEREADKEY( pGT, iEventMask );
from hb_gt_os2_ReadKey().
Now when 2-nd thread calls:

   KbdCharIn( s_key, IO_NOWAIT, ( HKBD ) * s_hk );

it fails with internal error. In OW this call is directly translated by:

   #define KbdCharIn          KBD16CHARIN

inside bsesub.h.
Why does it fail?
Why we have s_hk which is only low memory block initialized to NULL?
This code efectively works like:
   KbdCharIn( s_key, IO_NOWAIT, NULL );
so why we have s_hk variable if it does nothing?
OS2 API contains KbdGetFocus() and KbdFreeFocus(). If we begin to use
them to protect  can it help us?

You left this comment in gtos2.c:
   #if defined(HB_OS_OS2_GCC)
      /* 25/03/2000 - [EMAIL PROTECTED]
      OS/2 GCC hasn't got ToolKit headers available */
      #include <stdlib.h>
   #else
      #include <bsedos.h>
      #ifndef KBDTRF_EXTENDED_CODE
         #define KBDTRF_EXTENDED_CODE 0x02
      #endif
   #endif

It suggests me that in GCC builds KbdCharIn() is not directly translated
to KBD16CHARIN() but it's a wrapper function. Can you check its body and
what it exactly does? If the problem is not solved by some external setting
then the answer should be here.

> If I'm not wrong, openwatcom development, at least for os/2, has been stopped.

OS2 OW builds are still release. OW17a is the newest release.
AFAIK incoming 1.8 will also be released for OS2.

> Why are you trying to use it?

It allows to locate GCC only code and clean it.
It's C++ compiler so it allows to easy locate code which is not C++
compatible though here include G++ builds like in Linux should
also be solution.
It should allow to create cross binaries and I will want to add
support for it.
It should allow to make OS2 build test also for developers which
do not have OS2 what should greatly help us when we have to touch
code which is compiled conditionally only in OS2 builds.

best regards and many thanks for you help.
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to