RE: [C++-sig] unnamed enum bug
Hi.
I guess Roman means to put a constant with the same value in the global scope, something like this (untested):
{ scope unnamed;
unnamed.attr("CHANNEL_DIRECTION_ENUM_SIZE") = CHANNEL_DIRECTION_ENUM_SIZE; ... }
This is almost exactly what I mean. scope().attr("CHANNEL_DIRECTION_ENUM_SIZE") = int( CHANNEL_DIRECTION_ENUM_SIZE ); The same logic as VarExporter.py.
I'm not sure if everything just "works", but if it does, I guess that change is good enough to me. Note that normal enums are exported as usual. Roman, have you tested this? How does it work?
Yes I tested this and I use this patch in "production", also I quess that there is some case I failed to test. Small description: I implemented the same logic as in VarExporter.py. Also I export unnamed enums as int. The reason is simple: MSVC 7.1 could not compile scope().attr("CHANNEL_DIRECTION_ENUM_SIZE") = CHANNEL_DIRECTION_ENUM_SIZE; for some reason.
If everyone agress, I will apply this patch.
I agree :-) I attach 3 files: dummy.h - file that includes diferent enums definitions EnumExporter.py - patched file diff.txt - the difference between files( CVS version and EnumExporter.py ) Roman
participants (1)
-
Roman Yakovenko