Closed legerch closed 5 months ago
In SafeString.h try replacing
#if defined(ARDUINO_ARCH_SAM)
#define bool int
#endif
#ifdef __cplusplus
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
with
#ifdef __cplusplus
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
That change seems to work for SAM boards
In SafeString.h try replacing
#if defined(ARDUINO_ARCH_SAM) #define bool int #endif #ifdef __cplusplus #include <stdlib.h> #include <string.h> #include <ctype.h>
with
#ifdef __cplusplus #include <stdbool.h> #include <stdlib.h> #include <string.h> #include <ctype.h>
That change seems to work for SAM boards
I can confirm that this properly work, bool
is a proper boolean type with those changes.
Do you want me to update this PR with this method instead ?
No thats fine, I will do a new release with this fix and update the PlatformIO zips as well. Thanks for finding this.
Noted, thank you for maintaining this library :)
fixed in V4.1.33
When including "Safestring.h" library for an
ARDUINO_ARCH_SAM
, boolean type is redefined to an integer. This will pollute our sketch since this redefinition is inside the header.Fix it by using a custom boolean type name for this library