diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/androidfw/ResourceTypes.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/androidfw/ResourceTypes.h b/include/androidfw/ResourceTypes.h index a44975b..ba72cd5 100644 --- a/include/androidfw/ResourceTypes.h +++ b/include/androidfw/ResourceTypes.h @@ -36,6 +36,17 @@ namespace android { +/** + * In C++11, char16_t is defined as *at least* 16 bits. We do a lot of + * casting on raw data and expect char16_t to be exactly 16 bits. + */ +#if __cplusplus >= 201103L +struct __assertChar16Size { + static_assert(sizeof(char16_t) == sizeof(uint16_t), "char16_t is not 16 bits"); + static_assert(alignof(char16_t) == alignof(uint16_t), "char16_t is not 16-bit aligned"); +}; +#endif + /** ******************************************************************** * PNG Extensions * @@ -253,7 +264,8 @@ struct Res_value // Type of the data value. enum { - // Contains no data. + // The 'data' is either 0 or 1, specifying this resource is either + // undefined or empty, respectively. TYPE_NULL = 0x00, // The 'data' holds a ResTable_ref, a reference to another resource // table entry. @@ -351,6 +363,14 @@ struct Res_value COMPLEX_MANTISSA_MASK = 0xffffff }; + // Possible data values for TYPE_NULL. + enum { + // The value is not defined. + DATA_NULL_UNDEFINED = 0, + // The value is explicitly defined as empty. + DATA_NULL_EMPTY = 1 + }; + // The data for this item, as interpreted according to dataType. uint32_t data; @@ -836,7 +856,7 @@ struct ResTable_package uint32_t id; // Actual name of this package, \0-terminated. - char16_t name[128]; + uint16_t name[128]; // Offset to a ResStringPool_header defining the resource // type symbol table. If zero, this package is inheriting from @@ -1441,7 +1461,7 @@ struct ResTable_lib_entry uint32_t packageId; // The package name of the shared library. \0 terminated. - char16_t packageName[128]; + uint16_t packageName[128]; }; /** |