如果在C ++或C ++ / CLI下,以编程方式查找 [英] Find programmatically if under C++ or C++/CLI

查看:104
本文介绍了如果在C ++或C ++ / CLI下,以编程方式查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要我的C ++ / CLI标头即使在另一个平台下编译。当然,我不希望编译它们,只是忽略它们。

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.

这是否合适? (_MSC_VER)

Would this be appropriate ? (_MSC_VER)

#ifdef _MSC_VER

    using namespace System;

        namespace ENMFP {

            public ref struct Data {
            };
        }

#endif


推荐答案

您可以使用在这里

#ifdef __cplusplus_cli

using namespace System;

namespace ENMFP
{
    public ref struct Data
    {
        // ...
    };
}

#endif  // __cplusplus_cli

这篇关于如果在C ++或C ++ / CLI下,以编程方式查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆