Skip to content

Commit 49914a2

Browse files
committed
Fix build error due to bool keyword with gcc-15
* gcc-15 uses gnu23 for c. 'bool' is a keyword. TOPDIR/tmp/work/core2-64-oe-linux/paho-mqtt-c/1.3.14/git/src/MQTTPacket.h:31:22: error: 'bool' cannot be defined via 'typedef' 31 | typedef unsigned int bool; | ^~~~ TOPDIR/tmp/work/core2-64-oe-linux/paho-mqtt-c/1.3.14/git/src/MQTTPacket.h:31:22: note: 'bool' is a keyword with '-std=c23' onwards TOPDIR/tmp/work/core2-64-oe-linux/paho-mqtt-c/1.3.14/git/src/MQTTPacket.h:31:1: warning: useless type name in empty declaration 31 | typedef unsigned int bool; | ^~~~~~~ Signed-off-by: mark.yang <mark.yang@lge.com> Signed-off-by: markyang92 <pllpokko@alumni.kaist.ac.kr>
1 parent 2150ba2 commit 49914a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/MQTTPacket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
#include "LinkedList.h"
2929
#include "Clients.h"
3030

31+
#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
3132
typedef unsigned int bool;
33+
#endif
3234
typedef void* (*pf)(int, unsigned char, char*, size_t);
3335

3436
#include "MQTTProperties.h"

0 commit comments

Comments
 (0)