+typedef struct atomic_type_properties_t atomic_type_properties_t;
+struct atomic_type_properties_t {
+ unsigned size; /**< type size in bytes */
+ unsigned alignment; /**< type alignment in bytes */
+ unsigned flags; /**< type flags from atomic_type_flag_t */
+};
+
+static atomic_type_properties_t atomic_type_properties[ATOMIC_TYPE_LAST+1] = {
+ //ATOMIC_TYPE_INVALID = 0,
+ [ATOMIC_TYPE_VOID] = {
+ .size = 0,
+ .alignment = 0,
+ .flags = ATOMIC_TYPE_FLAG_NONE
+ },
+ [ATOMIC_TYPE_CHAR] = {
+ .size = 1,
+ .alignment = 1,
+ /* signed flag will be set when known */
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC,
+ },
+ [ATOMIC_TYPE_SCHAR] = {
+ .size = 1,
+ .alignment = 1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC
+ | ATOMIC_TYPE_FLAG_SIGNED,
+ },
+ [ATOMIC_TYPE_UCHAR] = {
+ .size = 1,
+ .alignment = 1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC,
+ },
+ [ATOMIC_TYPE_SHORT] = {
+ .size = 2,
+ .alignment = 2,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC
+ | ATOMIC_TYPE_FLAG_SIGNED
+ },
+ [ATOMIC_TYPE_USHORT] = {
+ .size = 2,
+ .alignment = 2,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC,
+ },
+ [ATOMIC_TYPE_INT] = {
+ .size = (unsigned) -1,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC
+ | ATOMIC_TYPE_FLAG_SIGNED,
+ },
+ [ATOMIC_TYPE_UINT] = {
+ .size = (unsigned) -1,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC,
+ },
+ [ATOMIC_TYPE_LONG] = {
+ .size = (unsigned) -1,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC
+ | ATOMIC_TYPE_FLAG_SIGNED,
+ },
+ [ATOMIC_TYPE_ULONG] = {
+ .size = (unsigned) -1,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC,
+ },
+ [ATOMIC_TYPE_LONGLONG] = {
+ .size = (unsigned) -1,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC
+ | ATOMIC_TYPE_FLAG_SIGNED,
+ },
+ [ATOMIC_TYPE_ULONGLONG] = {
+ .size = (unsigned) -1,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC,
+ },
+ [ATOMIC_TYPE_BOOL] = {
+ .size = (unsigned) -1,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_INTEGER | ATOMIC_TYPE_FLAG_ARITHMETIC,
+ },
+ [ATOMIC_TYPE_FLOAT] = {
+ .size = 4,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_FLOAT | ATOMIC_TYPE_FLAG_ARITHMETIC
+ | ATOMIC_TYPE_FLAG_SIGNED,
+ },
+ [ATOMIC_TYPE_DOUBLE] = {
+ .size = 8,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_FLOAT | ATOMIC_TYPE_FLAG_ARITHMETIC
+ | ATOMIC_TYPE_FLAG_SIGNED,
+ },
+ [ATOMIC_TYPE_LONG_DOUBLE] = {
+ .size = 12,
+ .alignment = (unsigned) -1,
+ .flags = ATOMIC_TYPE_FLAG_FLOAT | ATOMIC_TYPE_FLAG_ARITHMETIC
+ | ATOMIC_TYPE_FLAG_SIGNED,
+ },
+ /* complex and imaginary types are set in init_types */
+};
+