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

compile error if restrict keyword not supported #512

Closed
alfredh opened this issue Sep 7, 2022 · 2 comments · Fixed by #514
Closed

compile error if restrict keyword not supported #512

alfredh opened this issue Sep 7, 2022 · 2 comments · Fixed by #514

Comments

@alfredh
Copy link
Contributor

alfredh commented Sep 7, 2022

the restrict keyword is part of C99 but if the compiler does not support it,
compilation will fail.

Reference:

https://github.com/baresip/re/blob/main/include/re_fmt.h#L90

There are some compilers that partially supports C99, such as MSVC 2019 version 16.

@alfredh
Copy link
Contributor Author

alfredh commented Sep 7, 2022

other projects are using a macro wrapper:

https://ffmpeg.org/doxygen/1.2/attributes_8h.html#a69c6b995228f305482ad544113a51673

@sreimers
Copy link
Member

sreimers commented Sep 7, 2022

Looks like we can use __restrict as replacement, made a PR:

#514

https://docs.microsoft.com/en-us/cpp/cpp/extension-restrict?view=msvc-170

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 a pull request may close this issue.

2 participants