TIP: Click on subject to list as thread! ANSI
echo: msged_echo
to: All
from: Paul Edwards
date: 1996-12-19 00:29:48
subject: weird code

I've just spent an hour or so tracking down a bug in tobruk (actually,
MSGAPI38), and I traced it down to this code in api_sdm.c:

      #ifdef OS_2
      {       
#ifndef __BORLANDC__      
        extern void far pascal DosSleep(dword);        
        
        if((mn % 128)==127)
          DosSleep(1L);
#else
/*        extern void sleep(unsigned); */
        
        if ((mn % 128)==127)
          sleep(1);
#endif                    
      }
      #endif

The DosSleep(1L) call, under Watcom, is pushing something 1 onto the stack,
and then not adding 4 to the stack after the call.  If there is a *proper*
OS/2 prototype, ie #define INCL_DOS, #include , it generates
the proper code (at least in my test program).  It is obviously quite
stupid declaring your own shitty prototype for something that you shouldn't
be. I might be able to fix it by including os2.h (but I have bad memories
of trying things like that before), but I can't see any reason for the
code!

I am therefore going to delete the code.  If you have any technical reason
why I shouldn't do so, please let me know.  BFN.  Paul. 
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.