TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Fitzsimmons
from: Darin McBride
date: 1996-06-01 00:14:12
subject: Semaphores (16 & 32)

Hello Peter!

29 May 96 23:35, Peter Fitzsimmons wrote to Darin McBride:

 PF>> If you try to compile it for 32bits,  you might have to
 PF>> change the sem calls to "Dos16CreateSem", etc,  and

 DM>> Hmmm... from a scan of all 1MB of the \WATCOM\h\os2
 DM>> directory, there is no 'Dos16' calls.  :-/  Even scanning
 DM>> DOSCALL1.DLL,

 PF> Try looking in os2386.lib.

Thanks to Doug, I found this.  :-)

 PF> Since you've found smserial.dll,  I think you're wasting your
 PF> time trying to create the 16bit sems directly from 32bit code.

Not really.  If I were doing this 'professionally' rather than 'learning',
I would completely, fully, unequivocably, and enthusiastically agree with
you. As a learning excersize, however, I reserve the right to disagree. 
:-)

 PF> Here is the all the work you need to do:  Place this in your
 PF> 32bit C code (if it is C++,  use extern "C" {}). The compiler
 PF> will handle the 1632 conversion by itself:

 PF>  void pascal _far16 BbsSemSerialize(char *pszSemName, char
 PF> *pszSemEnv);

I received the same line from Scott Dudley directly.  :-)

 PF> (You're using watcom,  right? If IBM,  change __far16 to _Far16)

Watcom accepts _Far16 as well.

 PF> Set both parameters to NULL,  and it will use
 PF> "/sem/squish/default".

That's an interesting side effect... :-)  Thanks,

Darin McBride

--- GoldED/2 2.42.G0614
* Origin: Tanktalus' Tower BBS/RPGs Galore! (1:342/5015)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1
@PATH: 342/5015 61 3615/50 396/1 270/101 712/515 711/808 934

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™.