odl文件中的条件编译标志 [英] conditional compilation flags in odl file

查看:88
本文介绍了odl文件中的条件编译标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.odl文件中的#ifdef ... #endif标志等效于什么?在odl文件中,是否有可能有条件编译的接口方法?

例如

What is equivalent of #ifdef ... #endif flags in .odl files? Is it possible that in odl file, we shall have interface methods which are compiled conditionally ?

e.g.

interface {

methods:
   HRESULT func1([in] inputvar, [out] outvar);
   HRESULT func2([in] inputvar, [out] outvar);
   
   #ifdef THIRDPARTYDLL
   HRESULT func11([in] inputvar, [out] outvar);
   HRESULT func21([in] inputvar, [out] outvar);
   #endif
}


我使用的第三方库的运行时和开发人员许可证数量有限.一些接口方法直接支持库方法.

在某些安装了许可证的计算机上,我希望使用标志打开进行编译,而在其他计算机上,我希望使用标志关闭进行编译.

如何做到这一点?另外,可以使用在源文件中,IDL文件中定义的标志吗?在Visual Studio中,有一些用于在项目中定义预处理器的工具.但是C/C ++源文件和MIDL文件的预处理器集是不同的吗?


I am using a third-party library for which I have limited run-time and developer licenses. Some of the interface methods are in direct support of library methods.

On some machines where I have license installed, I want to compile with flag on and on other machines, I want to compile with flag off.

How this can be achieved? Also, it is possible to use a flag which defined in source files, in IDL file? In visual studio, there are facilities for defining pre-processor in project. But set of preprocessors for C/C++ source files and for MIDL files is different? can they be shared or can they be inherited from some common place?

推荐答案

希望这会有所帮助,但不确定多少.
http://msdn.microsoft.com/en-us/library/aa366773%28v = vs.85%29.aspx [ ^ ]
Hope this helps, but not sure how much.
http://msdn.microsoft.com/en-us/library/aa366773%28v=vs.85%29.aspx[^]


这篇关于odl文件中的条件编译标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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