#define guard(_name) \
CLASS(_name, __UNIQUE_ID(guard))
#define CLASS(_name, var) \
class_##_name##_t var __cleanup(class_##_name##_destructor) = \
class_##_name##_constructor
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
Yeah Rust wins this one hands down, without breaking a sweat, and without really even noticing there was a competition.