-
Notifications
You must be signed in to change notification settings - Fork 281
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
Do no undefine __APPLE__ on mac/ios builds #299
Comments
@tuexen already said he agrees with you and that they are very much willing to accept a pull request. |
I just did quick code review and I'm totally shocked that this code doesn't bomb. It's used by chrome in webrtc, strange that they didn't notice it. The problem is that I don't use/work with/on usrsctp. It's used/pulled in by another third party library, which in turn also pulled in by another third party library. I just noticed weird stuff going on and started investigation and ... I'm not sure if I can use/trust all of these libraries now. Complete disaster. |
I also did a quick review... this is dead code unless someone defines |
And apparently none of the browsers define it, so they aren't aware (or were aware and decided not to report it):
|
Right, so IIRC the problem you're describing is not the fact that
usrsctp.h is but the rest is not. So, if I interpret the code correctly and you're including a built version of usrsctp where the defines (and undefines) have not been propagated to your library, then including
This has been resolved apart from a single define. See the discussion in #275. |
usrsctp treats
usrscpt.h does different layout for
|
It would be better if usrsctp had consistent defines (USRSCTP_USERLAND, USRSCTP_SOMETHING_ELSE) and preferably wouldn't require user code to also define the same defines when using usrscpt headers. That usually requires some kind of config.h to be exported as a public header. |
Already pointed out that you don't need to define anything when including Yep, they aren't prefixed and the code certainly isn't going to win a beauty contest... but that shouldn't be our priority here. Unless you want to go for it. 🙂 |
This issue should be fixed by: 5be0c25. |
This was already reported and simply closed before. This is a bug that has to be fixed.
__APPLE__
is a known identifier for apple builds (mac/ios), this is insane to undefine it. More over, this isn't supported, as identifiers with leading underscores are reserved. You aren't supposed to define/undefine these, I hope it's not a surprise for you. If you need something special, then it should have been SCTP_APPLE or whatever.The way it is now is kind of crazy: some structs have different layout depending of presence of
__APPLE__
define. I hope you do not expect that any unrelated code that happens to use usrsctp library will also need to undefine__APPLE__
in their builds!? I also hope that tests for__APPLE__
in public headers doesn't affect layouts of these strucs in way that would corrupt anything that tries to use usrsctp on mac/ios. I'd be scared to touch this library with a long pole in a commercial product if I didn't do full code review for each use of__APPLE__
. Please, fix the bug to avoid these issues.The text was updated successfully, but these errors were encountered: