} var = { .in = x }; var.out; \
})
+// Poor man's static assert
+#define STATIC_ASSERT(x) extern int VG_(VG_(VG_(unused)))[(x) ? 1 : -1]
+
#endif /* __PUB_TOOL_BASICS_H */
/*--------------------------------------------------------------------*/
#include <stdio.h> // fprintf
#include <stdlib.h> // exit
+#include "pub_tool_basics.h" // STATIC_ASSERT
#include "vtest.h"
#define DEFOP(op,ukind) op, #op, ukind
/* Force compile time failure in case libvex_ir.h::IROp was updated
and the irops array is out of synch */
-extern int ensure_complete[
- (sizeof irops / sizeof *irops == Iop_LAST - Iop_INVALID - 1) ? 1 : -1
- ];
+STATIC_ASSERT \
+ (sizeof irops / sizeof *irops == Iop_LAST - Iop_INVALID - 1);
/* Return a descriptor for OP, iff it exists and it is implemented
for the current architecture. */