VirtualBox

Changeset 16383 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jan 29, 2009 5:35:12 PM (16 years ago)
Author:
vboxsync
Message:

IPRT: Added sanity checks for the [U]INTn_C macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/sanity.h

    r16346 r16383  
    188188AssertCompileSize(uint64_t, 8);
    189189
     190#define TEST_CONST_MACRO(c,t) \
     191    AssertCompile(sizeof(c) == sizeof(t) || (sizeof(c) == sizeof(int) && sizeof(t) < sizeof(int)) )
     192
     193TEST_CONST_MACRO(UINT8_C(1),  uint8_t);
     194TEST_CONST_MACRO(UINT16_C(1), uint16_t);
     195TEST_CONST_MACRO(UINT32_C(1), uint32_t);
     196TEST_CONST_MACRO(UINT64_C(1), uint64_t);
     197
     198TEST_CONST_MACRO(INT8_C(1),   int8_t);
     199TEST_CONST_MACRO(INT8_C(-1),  int8_t);
     200TEST_CONST_MACRO(INT16_C(1),  int16_t);
     201TEST_CONST_MACRO(INT16_C(-1), int16_t);
     202TEST_CONST_MACRO(INT32_C(1),  int32_t);
     203TEST_CONST_MACRO(INT32_C(-1), int32_t);
     204TEST_CONST_MACRO(INT64_C(1),  int64_t);
     205TEST_CONST_MACRO(INT64_C(-1), int64_t);
     206
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette