Skip to content

Commit 89928fc

Browse files
committed
🐛 C language compatibility
`bool` is a recognized keyword in C23 and later. Use `#include <stdbool.h>` as a version agnostic solution for use of `bool` as a type. This approach is backwards compatible to C99.
1 parent 399c0b2 commit 89928fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/temp_sensor/src/Types.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010

1111
#include <math.h>
1212

13+
// Include a type definition for `bool`.
14+
// This also ensures compatibility with C23 and later that recognize `bool` as a keyword.
15+
#include <stdbool.h>
16+
1317
// Application Type Definitions
1418
typedef unsigned int uint32;
1519
typedef int int32;
1620
typedef unsigned short uint16;
1721
typedef short int16;
1822
typedef unsigned char uint8;
1923
typedef char int8;
20-
typedef char bool;
2124

2225
// Application Special Value Definitions
2326
#ifndef TRUE

0 commit comments

Comments
 (0)