-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
SoftwareSerial breaks abs macro #30
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
Comments
I dug around a bit to see if I could find the origin of these lines, but it seems they were already present in the "NewSoftSerial" library that was merged into the Arduino core a long time ago (and renamed to "SoftwareSerial" there. That library was again based on ladyada's AFSoftSerial, but that did not have these lines. Unfortunately, it seems NewSoftSerial did not use any version control, and the changelog does not mention these either. In any case, I can't quite see why these undefs are needed. They are at the bottom of SoftwareSerial.h, so they cannot affect the contents of SoftwareSerial.h above. They might be needed for SoftwareSerial.cpp, but then they should be moved there, and not "pollute" the global scope. However, you suggest things work just fine with these line removed, so I'd be in favor of removing them (the more predictable the global scope is, the better). @cmaglie, @facchinm, would you agree? @florian-schweiger, care to prepare a PR for this? |
@matthijskooijman agree, let's get rid of that lines 🙂 |
Removed #undefs in SoftwareSerial.h that were marked as Arduino 0012 workaround and that broke several macros, including abs. See arduino#30
Removed #undefs in SoftwareSerial.h that were marked as Arduino 0012 workaround and that broke several macros, including abs. See arduino#30
Removed #undefs in SoftwareSerial.h that were marked as Arduino 0012 workaround and that broke several macros, including abs. See arduino/ArduinoCore-avr#30
When I include
SoftwareSerial.h
, other libraries break because theabs(x)
macro stops working. One particular library that stops functioning properly is uStepper.The reason for it seems to be a section at the bottom of
SoftwareSerial.h
that undefines several macros:I've commented this out in my project, and things are back to normal.
So I'm wondering, is this workaround still needed in the post-Arduino-0012 era?
The text was updated successfully, but these errors were encountered: