diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2014-02-18 19:34:04 +0100 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2014-02-19 16:09:29 +0100 |
commit | a2408d154eb9fa3fa9b07cc5a04e9b3744a9f81a (patch) | |
tree | ecd8a80ccdf80774dc26443d49623f4d2c5b5056 /cores/arduino/wiring_pulse.c | |
parent | f76c327aae447ca595a428c6783d817ec2f23ed9 (diff) |
Instead of #defining true and false, include stdbool.h
In C++, true and false are language keywords, so there is no need to
define them as macros. Including stdbool.h in C++ effectively changes
nothing. In C, true, false and also the bool type are not available, but
including stdbool.h will make them available.
Using stdbool.h means that we get true, false and the bool type in
whatever way the compiler thinks is best, which seems like a good idea
to me.
This also fixes the following compiler warnings if a .c file includes
both stdbool.h and Arduino.h:
warning: "true" redefined [enabled by default]
#define true 0x1
warning: "false" redefined [enabled by default]
#define false 0x0
This fixes #1570 and helps toward fixing #1728.
This only changed the AVR core, the SAM core already doesn't define true
and false (but doesn't include stdbool.h either).
Diffstat (limited to 'cores/arduino/wiring_pulse.c')
0 files changed, 0 insertions, 0 deletions