`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.
It's tough to have PRs bounce or to have a back and forth with contributors
about minor style quibbles. Sometimes it ends up just being easier to fix style
after the fact, but let's add some automation to help this!
This commit adds a script to run on CI and locally to verify the style of this
repository. There's a few stylistic guidelines to ensure that definitions are
understandable across the jungle of modules. This consistency should help assist
readability for any future readers!