C++ use of bool

David Bryan D.J.Bryan at cranfield.ac.uk
Fri May 5 16:06:10 BST 2000


In message <sKii6NAb9oE5EwYI at mk-net.demon.co.uk>
          Tony van der Hoff <OSLib at mk-net.demon.co.uk> wrote:

> On Thu, 4 May 2000, at 17:50:51, David Bryan <D.J.Bryan at cranfield.ac.uk>
> wrote on the subject "C++ use of bool":
> 
> >This could be used to tell if |bool| is a keyword.  Although, I
> >wouldn't be surprised if every version of g++ ever produced has
> >|bool| as a keyword.
> >
> So,
> 
> #if defined |__GNUC__|
>   #define BOOL_DEFINED
> #endif
> 
> would do the job, then?

As it turns out, g++ hasn't always had |bool| as a keyword.  There
have been releases of GCC 2.4.5 and 2.7.2.1 for RISC OS.  AFAIK,
no inbetween versions have been release for RISC OS.  Between
these two versions, |bool| became a keyword.  So the following
could be used.

  #ifdef __GNUG__
    #if __GNUG__ > 2 || (__GNUG__ == 2 && __GNUC_MINOR__ >= 7)
      #define BOOL_DEFINED
    #endif
  #endif

If it was considered important, the exact version of transition
could be found out.

> Now could you point me at the RISC OS port of G++, please :-)

  http://hard-mofo.dsvr.net/

:-)  With news at

  http://www.arcsite.de/hp/gcc/index.html

-- 
David Bryan




More information about the oslib-user mailing list