about summary refs log tree commit diff
path: root/nptl/pthreadP.h
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthreadP.h')
-rw-r--r--nptl/pthreadP.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index ae1b88143b..1cc80b6e3a 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -639,6 +639,14 @@ check_stacksize_attr (size_t st)
   return EINVAL;
 }
 
+#define ASSERT_TYPE_SIZE(type, size) 					\
+  _Static_assert (sizeof (type) == size,				\
+		  "sizeof (" #type ") != " #size)
+
+#define ASSERT_PTHREAD_INTERNAL_SIZE(type, internal) 			\
+  _Static_assert (sizeof ((type) { 0 }).__size >= sizeof (internal), 	\
+		  "sizeof (" #type ".__size) < sizeof (" #internal ")")
+
 #define ASSERT_PTHREAD_STRING(x) __STRING (x)
 #define ASSERT_PTHREAD_INTERNAL_OFFSET(type, member, offset)		\
   _Static_assert (offsetof (type, member) == offset,			\