delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/30/23:11:03

Date: Thu, 31 Dec 1998 05:10:48 +0100 (MET)
From: Gisle Vanem <giva AT bryggen DOT bgnett DOT no>
To: djgpp AT delorie DOT com
Subject: Re: BOOL crap :)
In-Reply-To: <368af097.10898047@news.w-link.net>
Message-ID: <Pine.UW2.3.95.981231050700.13249B-100000@bryggen.bgnett.no>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Thu, 31 Dec 1998, pjotr wrote:

> I recently installed DJGPP along with RHIDE. My problem is, I want to
> use the BOOl type variable in my C programs, but for some reason the
> compiler does not understand it, eventhough RHIDE acknowledges "bool"
> as a valid keyword (e.g. it turns white on screen).
> 
> I tried creating my own BOOL variable type by writing my own header
> file "types.h":
> 
> 
> #ifndef TYPES_H
> #define TYPES_H
> 
> enum BOOL
> {
>     FALSE = 0,
>     TRUE = 1;
> };
> 
> #endif /* TYPES_H */
> 
> 
> But even after this the compiler insists it does not know the BOOL
> type... Any sugestions?

Defining it your way, you must say "enum BOOL var;". Try:

typedef enum BOOL {
        FALSE = 0,
        TRUE
      } BOOL;


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019