home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.programmer
- Path: sparky!uunet!stanford.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!bjaspan
- From: bjaspan@athena.mit.edu (Barr3y Jaspan)
- Subject: Re: Linking 16-bit Code with 32-bit code
- Message-ID: <1992Aug28.014647.11813@athena.mit.edu>
- Sender: news@athena.mit.edu (News system)
- Nntp-Posting-Host: deathtongue.mit.edu
- Organization: Massachusetts Institute of Technology
- References: <1992Aug27.215047.28937@natinst.com>
- Date: Fri, 28 Aug 1992 01:46:47 GMT
- Lines: 15
-
- You need to declare the 16 bit functions as such explicitly, and declare all
- pointer arguments at 16 bit pointers. For example, if you were calling a 16
- bit version of strcpy from 32 bit code, you would need to declare it like this:
-
- _Cdecl _Far16 char * _Seg16 strcpy(char * _Seg16, char * _Seg16);
-
- Then, when you call the function from 32 bit code, C Set/2 will generate the
- appropriate magic. You may also have to declare the function as _System to C
- Set/2 will use the right calling convention (pure stack); I don't know how MSC
- passes arguments.
-
- This is unlikely to work with functions that accept or return structures.
-
- --
- Barr3y Jaspan, bjaspan@mit.edu
-