问题
I would like my C++/CLI headers to compile even when under another platform. Of course I am not expecting to compile them but just ignore them.
Would this be appropriate ? (_MSC_VER)
#ifdef _MSC_VER
using namespace System;
namespace ENMFP {
public ref struct Data {
};
}
#endif
Thanks !
回答1:
You can use the __cplusplus_cli
predefined macro documented here:
#ifdef __cplusplus_cli
using namespace System;
namespace ENMFP
{
public ref struct Data
{
// ...
};
}
#endif // __cplusplus_cli
来源:https://stackoverflow.com/questions/9976194/find-programmatically-if-under-c-or-c-cli