Use the containing class name as prefix, and add the name of the enum itself to the prefix for the scoped enums, instead of doing something strange and semi-random that we did before, with prefixes including the namespace (which should never be the case without "nspace" feature), but not the scoped enum. This also fixes renaming of enum elements, as a side effect, which didn't work before, add run test for enum_rename unit test to prove it.
12 lines
192 B
C
12 lines
192 B
C
#include <assert.h>
|
|
|
|
#include "enum_rename/enum_rename_wrap.h"
|
|
|
|
int main() {
|
|
assert(M_Jan == 0);
|
|
assert(May == 1);
|
|
assert(M_Dec == 2);
|
|
|
|
assert(S_Can == 1);
|
|
assert(S_Must == 2);
|
|
}
|