TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Mike Bilow
from: Darin McBride
date: 1996-05-24 00:41:08
subject: Semaphores (16 & 32)

MB> Mutex, and that is entirely a 16-bit program.

 MB> You must do the manual conversions in translating the 
 MB> prototypes found in the \WATCOM\H\OS21X directory, 
 MB> which contains the 16-bit OS/2 headers:

 MB> 2. Change all "far*" pointer arguments to "_far16*".

Shouldn't that be *_Seg16?  I found the following in OS2DEF.H in the
\WATCOM\h\os21x directory:

typedef VOID   * _Seg16  PVOID16;

However, when using:

typedef PVOID16 HSEM16;
typedef HSEM16 * _Seg16 PHSEM16;
typedef const char * _Seg16 PCSZ16;

and linking with \WATCOM\lib386\os2\os2286.lib, and running the executable,
I got SYS3175 errors.  My assumption, of course, is that I was misusing
something.  So I loaded in the debugger.  I got a task exception fault
BEFORE I hit the 'execute line' button.  

Changing to

typedef void _far16 * HSEM16;
typedef HSEM16 _far16 * PHSEM16;
typedef const char _far16 * PCSZ16;

doesn't seem to help any.  :-(

And, yes, the functions *are* surrounded by 'extern "C" {'... :-)


--- Maximus/2 3.01
* Origin: Tanktalus' Tower BBS (PVT) (1:342/708)
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™.