mirror of
https://github.com/verilator/verilator.git
synced 2025-01-04 05:37:48 +00:00
Add sizeof checks on types.
This commit is contained in:
parent
46be6d32c9
commit
cf2e8f7a9c
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user