Skip to content

[win] Don't build a custom nanosleep() when not needed#1256

Open
dimula73 wants to merge 3 commits into
mltframework:masterfrom
dimula73:kazakov/win-fix-build-llvm-mingw
Open

[win] Don't build a custom nanosleep() when not needed#1256
dimula73 wants to merge 3 commits into
mltframework:masterfrom
dimula73:kazakov/win-fix-build-llvm-mingw

Conversation

@dimula73

Copy link
Copy Markdown
Contributor

Instead of relying of the includes order we should properly
check if the function is actually provided by our version
of pthread library.

The patch basically reverts an original hack to resolve the
issue in msys2 and implements a proper detection mechanism
for the presence of nanosleep() in the pthread library

dimula73 added 2 commits June 10, 2026 17:29
Instead of relying of the includes order we should properly
check if the function is actually provided by our version
of pthread library.
@dimula73

dimula73 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

There is still an unorthodox usage of WIN_PTHREADS_TIME_H in mlt_types.h, which dates back from 2015. Theoretically, it could also be replaced with HAVE_PTHREAD_NANOSLEEP, though we would then have to add a public-interface definition for libmlt, like that:

target_compile_definitions(mlt PUBLIC "HAVE_PTHREAD_NANOSLEEP=${HAVE_PTHREAD_NANOSLEEP}")

Though I'm not sure if such a change is acceptable or not

It seems like there is some issue with that with MSYS2:

msys2/MINGW-packages#10459
@ddennedy

Copy link
Copy Markdown
Member

unorthodox usage of WIN_PTHREADS_TIME_H in mlt_types.h

It used to exist even if not in a standard. Google search on it first hit leads me to;
https://github.com/tonytheodore/winpthreads/blob/master/include/pthread_time.h

Since it is unorthodox it is OK to change it IMO.

@ddennedy

Copy link
Copy Markdown
Member

I approve the change but wait to see what you do about mlt_types.h

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