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

libvmaf: use _XOPEN_SOURCE, not _POSIX_C_SOURCE #1162

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

alyssais
Copy link
Contributor

@alyssais alyssais commented Jan 23, 2023

On BSD operating systems (I tested FreeBSD and NetBSD), with _POSIX_C_SOURCE=200112L, M_PI (needed by src/feature/ciede.c) is not exposed.

_XOPEN_SOURCE=600 exposes a superset of _POSIX_C_SOURCE=200112L, including M_PI.

Description of attempt #1

On BSD operating systems (I tested FreeBSD and NetBSD), this has the effect of hiding M_PI, which is needed by src/feature/ciede.c.

A patch doing exactly this is used in FreeBSD Ports.

@kylophone
Copy link
Collaborator

Breaks Windows CI, there should be a way to fix this for both BSDs and Windows.

On BSD operating systems (I tested FreeBSD and NetBSD), with
_POSIX_C_SOURCE=200112L, M_PI (needed by src/feature/ciede.c) is not
exposed.

_XOPEN_SOURCE=600 exposes a superset of _POSIX_C_SOURCE=200112L,
including M_PI.
@alyssais
Copy link
Contributor Author

I've reworked this in a way that is hopefully more correct and less likely to break Windows.

@alyssais alyssais changed the title libvmaf: don't use -D_POSIX_C_SOURCE libvmaf: use _XOPEN_SOURCE, not _POSIX_C_SOURCE Jan 24, 2023
@kylophone kylophone merged commit f47640f into Netflix:master Jan 24, 2023
@kylophone
Copy link
Collaborator

Merged. Thank you, Alyssa.

@alyssais alyssais deleted the _POSIX_C_SOURCE branch February 5, 2023 16:58
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