Beginner with OSLib

Tony van der Hoff OSLib at mk-net.demon.co.uk
Mon Sep 18 15:51:53 BST 2000


On Mon, 18 Sep 2000, at 14:51:46, Schaefer <sf at bonn.iz-soz.de> wrote on
the subject "Beginner with OSLib":

>
>Well, I got used to change those 'typedef bool' lines nearly everywhere and
>so I forgot to notify you - the change has been done so quickly...
>

Ahh, From the OSLib release notes:
------------
   Note that some gcc users have been undefining |bool| in types.h to
work round the generated error condition. THIS INTRODUCES AN ERROR, as
OSLib's bool was typedef'd as an integer (4 bytes), whereas sizeof(bool)
in g++ is 1 byte. 
   Anyone who has done this, and got has away with it, should be aware
of this ticking time-bomb, and amend their code at the earliest
opportunity.
------------

For example, from Jonathan, on this list:

<200004261901.MAA29169 at purple.trimedia.sv.sc.philips.com>
   Now that's what I call a serious bug.

   It's equally serious in all the cases where there's a |bool| 
output parameter: e g, almost every service call, and common things 
like


      extern void osspriteop_read_sprite_size
      (
         osspriteop_flags        flags,
         osspriteop_area  const *area,
         osspriteop_id           id,
         int                    *width,
         int                    *height,
         bool                   *mask,
         os_mode                *mode
      );

which, in C++, will be passed a byte pointer, and then write a word 
to it. It doesn't get much worse than that, I'd say ...


I hope you're not suggesting you've done *that* :-(

-- 
Tony van der Hoff         |  Mailto:tony at mk-net.demon.co.uk
                          |  Mailto:avanderhoff at iee.org
Buckinghamshire, England  |  http:www.mk-net.demon.co.uk



More information about the oslib-user mailing list