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
Contributor

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

@marcelverdult
marcelverdult force-pushed the fix/mesh-solar-none-macro branch from 83f4dc5 to a6e8dec Compare October 19, 2026 16:52
marcelverdult added a commit to marcelverdult/MeshCore_Refactor that referenced this pull request Oct 19, 2026
…proposal

This reverts the merge of fix/interface-type-none-macro-clash (2119cc8).

Both fixes for the meshsolar NONE macro collision work; this one is withdrawn
because the other one is already proposed upstream as meshcore-dev#3510 and the fork should
not carry a second, different solution for the same defect.

Measured before the swap, with the toolchain of the build environment action:
the rename built 29 environments, all 29 building; the upstream proposal builds
all five Heltec_mesh_solar environments, including companion_radio_usb and
companion_radio_ble, which do not build without either fix. The rename is
referenced in exactly one place, the default initializer in
src/helpers/MultiSerialInterface.h, so nothing else depends on it.

What the rename did better, for the record: the macros ERROR, WARNING, INFO,
LOG, DEBUG, FET and S are still defined by the same dependency header, so the
next enumerator that happens to share one of those names will hit the same
problem. The undef only covers NONE.
marcelverdult added a commit to marcelverdult/MeshCore_Refactor that referenced this pull request Oct 19, 2026

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