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

Fixed C deprecated enum support. Added C++03 support for examples #997

Merged
merged 7 commits into from
Dec 6, 2019

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Dec 3, 2019

No description provided.

srtcore/srt.h Outdated

#else
#define SRT_NO_DEPRECATED_ENUM
#define SRT_DECLARE_DEPRECATED_OPT(name, value) \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not look right: no deprecated values will be defined. Also I think we still want to have enum SRT_SOCKOPT_DEPRECATED {} for C compatibility.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've rewritten it completely. Tested with an old compiler in C, C++ and C++11 modes. Reports the misused deprecated option perfectly in all cases.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With gcc 4.4.1 deprecated option is not reported. Instead, I get

warning: 'SRT_SOCKOPT_DEPRECATED' is deprecated

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended is that you get a warning when this option is used, no matter what the warning says. If it works this way, that's good enough. I checked 4.4.1 and it reports exactly the line where the deprecated enum is used - even though the message isn't too readable.

@rndi rndi merged commit 3838fbf into Haivision:master Dec 6, 2019
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