home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4493 < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.1 KB  |  28 lines

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