I refer to a previous question: Is it possible to share an enum declaration between C# and unmanaged C++?
I would like to do something similar, but for an enum class instead of an enum:
C++ code:
enum class MyEnum { ONE, TWO, THREE, ... }
C# code:
public enum {ONE, TWO, THREE, ...}
Is there some preprocessor magic that can be done to achieve this? I cant seem to remove the "class" keyword in the C# part of the code.
eg: in MyEnum.cs
#if __LINE__ // if C++
#define public // C++ code: removes public keyword for C++
#else
#define class // does not work: unable to remove the class keyword for C#
#endif
enum class MyEnum { ONE, TWO, THREE, ... }
#if __LINE__
#undef public // ok: remove public = nothing definition in C++
#else
#undef class // does not work: #undef must be at the top of the file in C#
#endif