Skip to content

Fix Heltec Mesh Solar companion build: undef NONE macro from meshsolar logger - #3510

Open
marcelverdult wants to merge 1 commit into
meshcore-dev:devfrom
marcelverdult:fix/mesh-solar-none-macro
Open

marcelverdult wants to merge 1 commit into
meshcore-dev:devfrom
marcelverdult:fix/mesh-solar-none-macro

Conversation

@marcelverdult

Copy link
Copy Markdown
Contributor

Heltec_mesh_solar_companion_radio_ble / _usb currently fail to compile on dev:

.pio/libdeps/.../meshsolar/src/utils/logger.h:18:25: error: expected identifier before numeric constant
   18 | #define NONE            1
src/helpers/MultiSerialInterface.h:11:3: note: in expansion of macro 'NONE'

The meshsolar library's logger.h defines NONE (and other log-level names) as macros, which clashes with InterfaceType::NONE added in e672679. meshsolar only uses these names in #if checks inside its own header, so undefining NONE right after including meshSolarApp.h is safe.

Tested with pio run on dev (1934a49): all five Heltec_mesh_solar_* envs (companion ble/usb, repeater, room server, kiss modem) build. Without the change, _companion_radio_usb fails with the error above.

@Blake-Latchford Blake-Latchford left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which compiler this project uses, but I think this is why c++ introduced enum classes (also called scooped enums) .
https://en.cppreference.com/cpp/language/enum

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants