mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 16:28:53 +02:00
Add sizeof checks on types.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user