Add sizeof checks on types.

This commit is contained in:
Wilson Snyder 2019-01-25 18:26:14 -05:00
parent 46be6d32c9
commit cf2e8f7a9c

View File

@ -39,6 +39,16 @@
#define VL_VALUE_STRING_MAX_WIDTH 8192 ///< Max static char array for VL_VALUE_STRING
//===========================================================================
// Static sanity checks (when get C++11 can use static_assert)
typedef union {
char vluint8_incorrect[(sizeof(vluint8_t) == 1) ? 1:-1];
char vluint16_incorrect[(sizeof(vluint16_t) == 2) ? 1:-1];
char vluint32_incorrect[(sizeof(vluint32_t) == 4) ? 1:-1];
char vluint64_incorrect[(sizeof(vluint64_t) == 8) ? 1:-1];
} vl_static_checks_t;
//===========================================================================
// Global variables