_Static_assert (offsetof (type, member) == offset, \
"offset of " #member " field of " #type " != " \
ASSERT_PTHREAD_STRING (offset))
+#define ASSERT_PTHREAD_INTERNAL_MEMBER_SIZE(type, member, mtype) \
+ _Static_assert (sizeof (((type) { 0 }).member) != 8, \
+ "sizeof (" #type "." #member ") != sizeof (" #mtype "))")
#endif /* pthreadP.h */
ASSERT_TYPE_SIZE (pthread_mutex_t, __SIZEOF_PTHREAD_MUTEX_T);
- ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__nusers,
- __PTHREAD_MUTEX_NUSERS_OFFSET);
+ /* __kind is the only field where its offset should be checked to
+ avoid ABI breakage with static initializers. */
ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__kind,
__PTHREAD_MUTEX_KIND_OFFSET);
- ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__spins,
- __PTHREAD_MUTEX_SPINS_OFFSET);
-#if __PTHREAD_MUTEX_LOCK_ELISION
- ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__elision,
- __PTHREAD_MUTEX_ELISION_OFFSET);
-#endif
- ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__list,
- __PTHREAD_MUTEX_LIST_OFFSET);
+ ASSERT_PTHREAD_INTERNAL_MEMBER_SIZE (pthread_mutex_t, __data.__kind, int);
imutexattr = ((const struct pthread_mutexattr *) mutexattr
?: &default_mutexattr);
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
#define __PTHREAD_MUTEX_KIND_OFFSET 16
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 24
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
#define __PTHREAD_MUTEX_KIND_OFFSET 16
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 24
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
#define __PTHREAD_MUTEX_KIND_OFFSET 12
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 20
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
#define __PTHREAD_MUTEX_KIND_OFFSET 12
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 20
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 32
#define __PTHREAD_MUTEX_KIND_OFFSET 12
-#define __PTHREAD_MUTEX_SPINS_OFFSET 36
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 36
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
#define __PTHREAD_MUTEX_KIND_OFFSET 12
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 20
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
#define __PTHREAD_MUTEX_KIND_OFFSET 16
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 24
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
#define __PTHREAD_MUTEX_KIND_OFFSET 12
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 20
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
#define __PTHREAD_MUTEX_KIND_OFFSET 12
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 20
#if _MIPS_SIM == _ABI64
-# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
# define __PTHREAD_MUTEX_KIND_OFFSET 16
-# define __PTHREAD_MUTEX_SPINS_OFFSET 20
-# define __PTHREAD_MUTEX_ELISION_OFFSET 22
-# define __PTHREAD_MUTEX_LIST_OFFSET 24
#else
-# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
# define __PTHREAD_MUTEX_KIND_OFFSET 12
-# define __PTHREAD_MUTEX_SPINS_OFFSET 20
-# define __PTHREAD_MUTEX_ELISION_OFFSET 22
-# define __PTHREAD_MUTEX_LIST_OFFSET 20
#endif
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
#define __PTHREAD_MUTEX_KIND_OFFSET 12
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 20
#include <bits/wordsize.h>
#if __WORDSIZE == 64
-# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
# define __PTHREAD_MUTEX_KIND_OFFSET 16
-# define __PTHREAD_MUTEX_SPINS_OFFSET 20
-# define __PTHREAD_MUTEX_ELISION_OFFSET 22
-# define __PTHREAD_MUTEX_LIST_OFFSET 24
#else
-# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
# define __PTHREAD_MUTEX_KIND_OFFSET 12
-# define __PTHREAD_MUTEX_SPINS_OFFSET 20
-# define __PTHREAD_MUTEX_ELISION_OFFSET 22
-# define __PTHREAD_MUTEX_LIST_OFFSET 20
#endif
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
#define __PTHREAD_MUTEX_KIND_OFFSET 16
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 24
#include <bits/wordsize.h>
#if __WORDSIZE == 64
-# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
# define __PTHREAD_MUTEX_KIND_OFFSET 16
-# define __PTHREAD_MUTEX_SPINS_OFFSET 20
-# define __PTHREAD_MUTEX_ELISION_OFFSET 22
-# define __PTHREAD_MUTEX_LIST_OFFSET 24
#else
-# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
# define __PTHREAD_MUTEX_KIND_OFFSET 12
-# define __PTHREAD_MUTEX_SPINS_OFFSET 20
-# define __PTHREAD_MUTEX_ELISION_OFFSET 22
-# define __PTHREAD_MUTEX_LIST_OFFSET 20
#endif
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
#define __PTHREAD_MUTEX_KIND_OFFSET 12
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 20
#include <bits/wordsize.h>
#if __WORDSIZE == 64
-# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
# define __PTHREAD_MUTEX_KIND_OFFSET 16
-# define __PTHREAD_MUTEX_SPINS_OFFSET 20
-# define __PTHREAD_MUTEX_ELISION_OFFSET 22
-# define __PTHREAD_MUTEX_LIST_OFFSET 24
#else
-# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
# define __PTHREAD_MUTEX_KIND_OFFSET 12
-# define __PTHREAD_MUTEX_SPINS_OFFSET 20
-# define __PTHREAD_MUTEX_ELISION_OFFSET 22
-# define __PTHREAD_MUTEX_LIST_OFFSET 20
#endif
-#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
#define __PTHREAD_MUTEX_KIND_OFFSET 16
-#define __PTHREAD_MUTEX_SPINS_OFFSET 20
-#define __PTHREAD_MUTEX_ELISION_OFFSET 22
-#define __PTHREAD_MUTEX_LIST_OFFSET 24