diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-09-11 16:13:19 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-09-11 16:13:19 +0300 |
commit | 61ad04afd5236e2a6a0d4b4f2caa3bab4a820c99 (patch) | |
tree | beea1aa405bb022927fc0eb5b8f4982083b68458 /pb.h | |
parent | 5b9ad17dc2014d7506a7dde92281d8c36a1433e4 (diff) | |
parent | 9f93d39f728c3e87b0ab482aa604c5cad4b1c86e (diff) |
Merge branch 'dev_tests_using_scons'
Diffstat (limited to 'pb.h')
-rw-r--r-- | pb.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -215,6 +215,17 @@ struct _pb_field_t { } pb_packed; PB_PACKED_STRUCT_END +/* Make sure that the standard integer types are of the expected sizes. + * All kinds of things may break otherwise.. atleast all fixed* types. */ +STATIC_ASSERT(sizeof(int8_t) == 1, INT8_T_WRONG_SIZE) +STATIC_ASSERT(sizeof(uint8_t) == 1, UINT8_T_WRONG_SIZE) +STATIC_ASSERT(sizeof(int16_t) == 2, INT16_T_WRONG_SIZE) +STATIC_ASSERT(sizeof(uint16_t) == 2, UINT16_T_WRONG_SIZE) +STATIC_ASSERT(sizeof(int32_t) == 4, INT32_T_WRONG_SIZE) +STATIC_ASSERT(sizeof(uint32_t) == 4, UINT32_T_WRONG_SIZE) +STATIC_ASSERT(sizeof(int64_t) == 8, INT64_T_WRONG_SIZE) +STATIC_ASSERT(sizeof(uint64_t) == 8, UINT64_T_WRONG_SIZE) + /* This structure is used for 'bytes' arrays. * It has the number of bytes in the beginning, and after that an array. * Note that actual structs used will have a different length of bytes array. |