Suggestions

Tony van der Hoff OSLib at mk-net.demon.co.uk
Thu Apr 27 09:52:51 BST 2000


On Wed, 26 Apr 2000, at 22:12:04, RP Lund <ron at rplund.demon.co.uk> wrote
on the subject "Suggestions":

>In article <200004261901.MAA29169 at purple.trimedia.sv.sc.philips.com>,
>   Jonathan Coxhead <jonathan at doves.demon.co.uk> wrote:

>>    This is a platform-specific thing, so the answer for Linux doesn't 
>> tell us much about what we ned to know. If it's true for RISC O S as 
>> well, for me it carries the implication that no-one uses OSLib with 
>> C++. But I know they do, so it can't be. (Does that make sense?)
>
>>    If RISC O S C++ has |sizeof (bool) == 1|, we are stuck, as Ainsley 
>> says. But as long as it is 4, no problems, and no change necessary.
>
>#include <stdio.h>
>
>int main(int argc, char **argv)
>{
>  printf("RiscOS G++ size of bool is %d\n", sizeof(bool));
>
>  return 0;
>}
>
>
>g++ bool.cc -o bool -liostream 
>Drlink AOF Linker  Version 0.34  01/02/98
>bool 
>RiscOS G++ size of bool is 1
>
>Oh dear!  but I haven't had any problems with it yet.
>

And, compiling the above with CFront, results in:

c++ -c -depend !Depend -IC: -o @.o.main @.c++.main 
Acorn C++ Language System 3.1 [May 25 1995]
"c++.main", line 5: error:  bool undefined
Command failed with return code 1


Which explains why CFront users won't have seen a problem; they've just
(unwittingly?) used OSLib's definition of bool.

Now, __cplusplus *is* defined by CFront, so using that as a test for
defining bool in types.h is not entirely satisfactory!

Yuk!

>
>PS Please leave the -D__swi alone. I'm used to it now!
>
OK, it's cool; only a suggestion ;-)

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