Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

byte: workaround for c++17 std::byte definition #8208

Closed
wants to merge 1 commit into from

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented Jul 10, 2021

This patch renames the Arduino type byte to something else in order to avoid ambiguous/conflicting types when c++17, byte, and using namespace std are used together.
This follows up #8089 (comment), gmag11/NtpClient#115 and things4u/ESP-1ch-Gateway#82.

This comment is true but libraries and projects will prefer to use previous version of this core than to fix.
In the Arduino world, ascendant compatibility still prevails.

This is a hack, relying on the following facts

  • Arduino byte is always defined in Arduino.h
  • std::byte is declared only in <cstddef> <functional> and <bits/cpp_type_traits.h>.
    The two latters were found with grep after noticing that the first was not sufficient.

fixes #8089

@d-a-v d-a-v added this to the 3.0.2 milestone Jul 10, 2021
@d-a-v d-a-v closed this Jul 10, 2021
@d-a-v d-a-v removed this from the 3.0.2 milestone Jul 10, 2021
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.

weird error in arduino.h on makeWord () with core 3.0.0
1 participant