Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork740
Improve Arduino compatibility with the STL (min and max macro)#399
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Replaced the min and max macros with std::min and std::max to allow compilation of bits/stl_algobase.h, a core component of many STL components such as std::function.
per1234 commentedApr 11, 2019
They did this in the ESP8266 core for Arduino and it caused breakage due to Arduino's traditional macro-based Examples:
Demonstration code that compiled before this change, but causes an error after: You can argue that the code that broke is bad code, but the impact of this change should at least be considered. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Fixed stylingCo-Authored-By: db-dropDatabase <noah@koontzs.com>
Created multi-type template for min and max.
prototypicalpro commentedApr 11, 2019
Good point. I've replaced the |
NameOfTheDragon commentedAug 8, 2019
This is a much needed PR for SAMD boards, I hope it will be merged soon. I tried the changes locally by pasting directly into my local |
prototypicalpro commentedAug 21, 2019
NameOfTheDragon left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This can't get into a release fast enough as far as I'm concerned. I keep having to manually edit my Arduino.h file with these changes or my code will not build.
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
amirna2 commentedSep 30, 2020
Any ideas when this is going to be merged? Currently, I am having to manually patch each time I use an Arduino Zero based board. |
matthijskooijman commentedOct 1, 2020
If I read the PR correctly, it now removes the Also, in theArduinoCore-API repo, this is also fixed in a similar way, but with even more reliable macros for C. Seearduino/ArduinoCore-API#85 for some discussion about this and other related changes. |
prototypicalpro commentedOct 1, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@matthijskooijman The |
matthijskooijman commentedOct 3, 2020
They are, but they are now inside the
I'm not sure, at some point all of this code should just be replaced by the API versions (seearduino/ArduinoCore-API#95), but I'm not sure what the progress on that is. Also, I'm unsure if any such changes would still be merged here separetely, that's something for the Arduino devs to answer, I guess. |
aentinger commentedNov 26, 2020
As far as I can see your proposed changes have made it intoArduinoCore-API. Since#567 has been merged you should have your desired functionality. Please reopen if you've got a different opinion. |
matthijskooijman commentedNov 26, 2020
@aentinger IIUC#567 only adds automated testing in preparation of merging ArduinoCore-API here, right? I don't see the API used in master yet? Regardless, I think this can be closed, as the PR as-is is not ideal and will probably not be merged with an upcoming -API merge. |
aentinger commentedNov 26, 2020
My bad, I linked the wrong PR. In fact,#560 which was merged just yesterday, brought |
matthijskooijman commentedNov 26, 2020
Ah, I see that the files from ArduinoCore-API have been imported verbatim now, rather than in an |
aentinger commentedNov 27, 2020
Hi 👋 that's not correct. The API needs to be symlinked in into an |
matthijskooijman commentedNov 27, 2020
Right, I didn't look close enough again. I see how it works now, thanks! |
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
### New in v1.7.01. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
Replaced the min and max macros with std::min and std::max to allow compilation of bits/stl_algobase.h, a core component of many STL components such as std::function.