-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add PTHREAD_*_MUTEX_INITIALIZER_NP for glibc #960
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
Conversation
rust 1.0 didn't like it:
|
Working around the rust 1.0 issue is an abuse of style.rs, but in the end, I think it's much better this way. |
Could the |
See the original patch and how it blantantly failed to build on rust 1.0. I also find it's a mess to have this spread across multiple files. |
Hm I no longer see the logs, but presumably there exist some construction that works, right? |
Apparently, rust 1.0 didn't support |
Yes that's why everything uses |
I tried
|
Er yes, I mean in the code itself, aka |
|
Ah ok, I could make it work. |
ping @alexcrichton |
@glandium hm this still has all the definitions in one location? Could the definitions not be pushed down into their respective modules and avoid the need for |
Argh, it looks like I rebased and pushed the wrong branch after #962. |
`pthread_mutex_t` varies across architectures, in several ways: - endianness alters the ordering of bytes, since the contents of the struct are larger than 8-bit. - its length varies. - the location of the mutex kind (`PTHREAD_MUTEX_RECURSIVE`, `PTHREAD_MUTEX_ERRORCHECK` or `PTHREAD_MUTEX_ADAPTIVE_NP`) varies between 32-bit and 64-bit: On 32-bit architectures, it is preceded by three int/unsigned int, while on 64-bit architectures, it is preceded by four of them. These initializers are only available from <pthread.h> when _GNU_SOURCE is defined. Relax the cfg_if check in ci/style.rs to allow #[cfg(target_endian)] tests.
@bors: r+ |
📌 Commit d901327 has been approved by |
Add PTHREAD_*_MUTEX_INITIALIZER_NP for glibc `pthread_mutex_t` varies across architectures, in several ways: - endianness alters the ordering of bytes, since the contents of the struct are larger than 8-bit. - its length varies. - the location of the mutex kind (`PTHREAD_MUTEX_RECURSIVE`, `PTHREAD_MUTEX_ERRORCHECK` or `PTHREAD_MUTEX_ADAPTIVE_NP`) varies between 32-bit and 64-bit: On 32-bit architectures, it is preceded by three int/unsigned int, while on 64-bit architectures, it is preceded by four of them. These initializers are only available from <pthread.h> when _GNU_SOURCE is defined.
☀️ Test successful - status-appveyor, status-travis |
Without this, the entried added in rust-lang/libc#960 are never tested.
Without this, the entries added in rust-lang/libc#960 are never tested.
Without this, the entries added in rust-lang/libc#960 are never tested.
Without this, the entries added in rust-lang#960 are never tested.
Without this, the entries added in rust-lang/libc#960 are never tested.
Without this, the entries added in rust-lang#960 are never tested.
pthread_mutex_t
varies across architectures, in several ways:struct are larger than 8-bit.
PTHREAD_MUTEX_RECURSIVE
,PTHREAD_MUTEX_ERRORCHECK
orPTHREAD_MUTEX_ADAPTIVE_NP
) variesbetween 32-bit and 64-bit: On 32-bit architectures, it is preceded by
three int/unsigned int, while on 64-bit architectures, it is preceded
by four of them.
These initializers are only available from <pthread.h> when _GNU_SOURCE
is defined.