OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
Boolean

Boolean type and constants. More...

Macros

#define FALSE   0
#define false   0
#define TRUE   0xFF
#define true   1

Typedefs

typedef unsigned char bool

Detailed Description

Boolean type and constants.

Warning
TRUE is 0xFF, not 1! This matches SNES convention where bit patterns are often used. Always compare with != FALSE rather than == TRUE.
if (flag) { } // Good
if (flag != FALSE) {} // Good
if (flag == TRUE) {} // Bad! Will fail for non-0xFF truthy values
#define TRUE
Definition types.h:151
#define FALSE
Definition types.h:150

Macro Definition Documentation

◆ FALSE

#define FALSE   0

◆ false

#define false   0

◆ TRUE

#define TRUE   0xFF

◆ true

#define true   1

Typedef Documentation

◆ bool

typedef unsigned char bool