Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: net.lang.c Subject: Re: Boolean Operators Slighted in C Message-ID: <6092@elsie.UUCP> Date: Tue, 6-May-86 18:40:14 EDT Article-I.D.: elsie.6092 Posted: Tue May 6 18:40:14 1986 Date-Received: Thu, 8-May-86 08:34:18 EDT References: <838@ihwpt.UUCP> <412@brl-smoke.ARPA> Distribution: net Organization: NIH-LEC, Bethesda, MD Lines: 31 Summary: Reinventing the wheel > The. . .header file that I mentioned a few days ago. . . > contains the following: > > typedef int bool; /* boolean data */ > #define false 0 > #define true 1 My recommendation to folks would be to use the defines that appear in the 4.?bsd version of "curses.h"-- # define TRUE (1) # define FALSE (0) --on a conditional basis in any "nifty_header.h" file, a la: #ifndef TRUE #define TRUE (1) #define FALSE (0) #endif Using the "unnecessary" parentheses that appear in "curses.h" will prevent any "redefined to a different value" diagnostics if you both #include "curses.h" and #include "nifty_header.h" while conditionalizing the definitions as above will prevent "redefined (though not to a different value)" diagnostics if you include both files in the order shown above. -- UUCP: ..decvax!seismo!elsie!ado ARPA: elsie!ado@seismo.ARPA DEC, VAX, Elsie & Ado are Digital, Borden & Shakespeare trademarks.