home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3786 < prev    next >
Encoding:
Text File  |  1992-07-26  |  1.6 KB  |  51 lines

  1. Path: sparky!uunet!iWarp.intel.com|imutm1.de.intel.com!susan!bofe!jonas!rommel
  2. From: rommel@jonas.bofe.sub.org (Kai Uwe Rommel)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: emx/g++ os2.h
  5. Distribution: world
  6. Message-ID: <711998759snx@jonas.bofe.sub.org>
  7. Date: Fri, 24 Jul 92 17:25:59 GMT
  8. Organization: Private
  9. Lines: 40
  10.  
  11. In the emx/g++ distribution, C++ wrappers for some C include headers
  12. are missing, such as for os2.h. They can be constructed very easily,
  13. such as the following include.cpp/os2.h for os2.h:
  14.  
  15. #ifndef _os2_h
  16. #define _os2_h 1
  17. extern "C" {
  18. #include_next <os2.h>
  19. }
  20. #endif
  21.  
  22. That's all there is to do to call OS/2 API functions from C++ code.
  23. Similar wrapper headers can be created for process.h and other emx/gcc
  24. headers for which the C++ wrapper is missing.
  25.  
  26. Note: the above sample works also with the IBM OS/2 toolkit headers,
  27. if the icc2gcc contribution by Johannes Martin is used (strongly
  28. recommended). But there is a bug in the bsedos.h, in the prototype for
  29. DosSetPriority at line 164. It uses the reserved C++ keyword "class"
  30. as a parameter template.
  31.  
  32. Change
  33.  
  34.    APIRET APIENTRY  DosSetPriority(ULONG scope, ULONG class, LONG delta, ULONG PorTid);
  35.  
  36. to
  37.  
  38.    APIRET APIENTRY  DosSetPriority(ULONG scope, ULONG _class, LONG delta, ULONG PorTid);
  39.  
  40. or similar.
  41.  
  42. Kai Uwe Rommel
  43.  
  44. --
  45. /* Kai Uwe Rommel                                      Muenchen, Germany *
  46.  * rommel@jonas.bofe.sub.org                       Phone +49 89 723 4101 *
  47.  * rommel@informatik.tu-muenchen.de                  Fax +49 89 723 7889 */
  48.  
  49. DOS ... is still a real mode only non-reentrant interrupt
  50. handler, and always will be.                -Russell Williams
  51.