Index: bhyverun.h =================================================================== --- bhyverun.h +++ bhyverun.h @@ -29,12 +29,6 @@ #ifndef _FBSDRUN_H_ #define _FBSDRUN_H_ -#ifndef CTASSERT /* Allow lint to override */ -#define CTASSERT(x) _CTASSERT(x, __LINE__) -#define _CTASSERT(x, y) __CTASSERT(x, y) -#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] -#endif - #define VMEXIT_CONTINUE (0) #define VMEXIT_ABORT (-1) Index: pci_emul.h =================================================================== --- pci_emul.h +++ pci_emul.h @@ -160,6 +160,7 @@ uint32_t addrhi; uint16_t msgdata; } __packed; +static_assert(sizeof(struct msicap) == 14, "compile-time assertion failed"); struct msixcap { uint8_t capid; @@ -168,6 +169,7 @@ uint32_t table_info; /* bar index and offset within it */ uint32_t pba_info; /* bar index and offset within it */ } __packed; +static_assert(sizeof(struct msixcap) == 12, "compile-time assertion failed"); struct pciecap { uint8_t capid; @@ -202,6 +204,7 @@ uint16_t slot_control2; uint16_t slot_status2; } __packed; +static_assert(sizeof(struct pciecap) == 60, "compile-time assertion failed"); typedef void (*pci_lintr_cb)(int b, int s, int pin, int pirq_pin, int ioapic_irq, void *arg); Index: pci_emul.c =================================================================== --- pci_emul.c +++ pci_emul.c @@ -31,9 +31,9 @@ #include #include -#include #include +#include #include #include #include @@ -755,16 +755,6 @@ return (err); } -#ifdef __GNU_C__ -#define WRAPPED_CTASSERT(x) CTASSERT(x) __unused -#else -#define WRAPPED_CTASSERT(x) CTASSERT(x) -#endif - -WRAPPED_CTASSERT(sizeof(struct msicap) == 14); -WRAPPED_CTASSERT(sizeof(struct msixcap) == 12); -WRAPPED_CTASSERT(sizeof(struct pciecap) == 60); - void pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr) { Index: task_switch.c =================================================================== --- task_switch.c +++ task_switch.c @@ -37,11 +37,11 @@ #include #include +#include +#include #include #include #include -#include -#include #include @@ -91,7 +91,7 @@ uint16_t tss_trap; uint16_t tss_iomap; }; -CTASSERT(sizeof(struct tss32) == 104); +static_assert(sizeof(struct tss32) == 104, "compile-time assertion failed"); #define SEL_START(sel) (((sel) & ~0x7)) #define SEL_LIMIT(sel) (((sel) | 0x7))