Article View: comp.os.os2.programmer
Article #480emx/g++ os2.h
From: Kai Uwe Rommel
Date: Fri, 24 Jul 1992 17:25
Date: Fri, 24 Jul 1992 17:25
40 lines
1692 bytes
1692 bytes
In the emx/g++ distribution, C++ wrappers for some C include headers
are missing, such as for os2.h. They can be constructed very easily,
such as the following include.cpp/os2.h for os2.h:
#ifndef _os2_h
#define _os2_h 1
extern "C" {
#include_next <os2.h>
}
#endif
That's all there is to do to call OS/2 API functions from C++ code.
Similar wrapper headers can be created for process.h and other emx/gcc
headers for which the C++ wrapper is missing.
Note: the above sample works also with the IBM OS/2 toolkit headers,
if the icc2gcc contribution by Johannes Martin is used (strongly
recommended). But there is a bug in the bsedos.h, in the prototype for
DosSetPriority at line 164. It uses the reserved C++ keyword "class"
as a parameter template.
Change
APIRET APIENTRY DosSetPriority(ULONG scope, ULONG class, LONG delta, ULONG PorTid);
to
APIRET APIENTRY DosSetPriority(ULONG scope, ULONG _class, LONG delta, ULONG PorTid);
or similar.
Kai Uwe Rommel
--
/* Kai Uwe Rommel Muenchen, Germany *
* rommel@jonas.bofe.sub.org Phone +49 89 723 4101 *
* rommel@informatik.tu-muenchen.de Fax +49 89 723 7889 */
DOS ... is still a real mode only non-reentrant interrupt
handler, and always will be. -Russell Williams
Technical Details
Message-ID:
<711998759snx@jonas.bofe.sub.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!iWarp.intel.com|imutm1.de.intel.com!susan!bofe!jonas!rommelShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!iWarp.intel.com|imutm1.de.intel.com!susan!bofe!jonas!rommel From: rommel@jonas.bofe.sub.org (Kai Uwe Rommel) Newsgroups: comp.os.os2.programmer Subject: emx/g++ os2.h Distribution: world Message-ID: <711998759snx@jonas.bofe.sub.org> Date: Fri, 24 Jul 92 17:25:59 GMT Organization: Private Lines: 40