🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
2 messages
2 total messages Started by Kai Uwe Rommel Fri, 24 Jul 1992 17:25
emx/g++ os2.h
#480
Author: Kai Uwe Rommel
Date: Fri, 24 Jul 1992 17:25
40 lines
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
emx/g++ os2.h
#512
Author: Andreas Kaiser
Date: Mon, 27 Jul 1992 03:40
19 lines
1221 bytes
In article <711998759snx@jonas.bofe.sub.org> rommel@jonas.bofe.sub.org writes:

  > 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.

There is another bug in BSEDOS.H. The definitions of the bit-field
structs FDATE and FTIME are done using UINT. IBM C doesn't care and
makes it 16-bit anyway. GCC is more "clever" and makes it 32-bit since
it is UINT, not USHORT. So all structs containing FDATE and FTIME have
wrong offsets.

To fix it, simple change UINT to USHORT in FDATE and FTIME.

:::::::::::::::::::: subnet:  ak@ananke.stgt.sub.org
:: Andreas Kaiser :: fidonet: 2:241/7220.9
::::::::::::::::::::
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads