Hi,
working to wrap the ArduinoBLE library to be used with an Arduino GIGA R1.
Getting this error when compiling a test sketch:
I confirmed the issue is caused by a macro named EMPTY coming from the Arduino GIGA (mbed / Zephyr / CMSIS) core.
Undefining EMPTY in B4RDefines.h is not sufficient, because the macro is reintroduced per translation unit by the Arduino core.
The only robust fix is to undefine EMPTY locally in rCore.h:
This keeps API compatibility and avoids renaming core symbols.
Another option would be to rename EMPTY to EMPTYSTR in rCore.h and rCore.cpp:
Is there another solution for this instead modifying the B4R rCore?
working to wrap the ArduinoBLE library to be used with an Arduino GIGA R1.
Getting this error when compiling a test sketch:
B4X:
Basic\B4R\Objects\src\rCore.h:614:40: error: expected unqualified-id before ';' token 614 | static B4RString* EMPTY; | ^ In file included from C:...
I confirmed the issue is caused by a macro named EMPTY coming from the Arduino GIGA (mbed / Zephyr / CMSIS) core.
Undefining EMPTY in B4RDefines.h is not sufficient, because the macro is reintroduced per translation unit by the Arduino core.
The only robust fix is to undefine EMPTY locally in rCore.h:
B4X:
// --- Fix macro collision with Zephyr / mbed ---
#ifdef EMPTY
#undef EMPTY
#endif
static B4RString* EMPTY;
Another option would be to rename EMPTY to EMPTYSTR in rCore.h and rCore.cpp:
B4X:
static B4RString* EMPTYSTR;
static B4RString be_empty;
B4RString* B4RString::EMPTYSTR = be_empty.wrap("");
Is there another solution for this instead modifying the B4R rCore?