我怎样才能Eclipse来索引code #IFDEF .... #ENDIF内 [英] How can I get Eclipse to index code inside #ifdef .... #endif

查看:539
本文介绍了我怎样才能Eclipse来索引code #IFDEF .... #ENDIF内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse来对一些C code工作,它不是索引条件编译块像这里面code:

I'm using eclipse to work on some c code and it is not indexing code inside conditional compilation blocks like this:

#ifdef USE_FEATURE_A
int feature_a(...) {
   some = code(here);
}
#endif

我怎样才能Eclipse来索引feature_a功能?

How can I get eclipse to index the feature_a function?

推荐答案

您可以告诉Eclipse的 USE_FEATURE_A 定义。打开你的项目属性,并转到C / C ++常规 - >路径和符号页,在符号选项卡中单击添加按钮,并把 USE_FEATURE_A 中名称费尔德,然后单击确定。

You could tell eclipse that USE_FEATURE_A is defined. Open your project properties and go to the "C/C++ General->Paths and Symbols" page, under the "Symbols" tab click the "Add" button and put USE_FEATURE_A in the name feild and click OK.

请注意:这将导致它无法索引任何的#else 双方你的preprocessor的东西......所以,除非他们都像在你的问题不能AFAIK,但如果是他们你是好。 (Eclipse中包含使用它来analyize您code以上所有的东西确实是基本相同,增加-DUSE_FEATURE_A到命令行让Eclipse的preprocessor将表现不同从一个在C preprocessor您编译器)

Note: this will cause it not to index any #else sides to your preprocessor stuff... so unless they are all like the one in question you can't AFAIK, but if they are they you're good. (Eclipse contains a C preprocessor that it uses to analyize your code all the stuff above does is essentially the same as adding -DUSE_FEATURE_A to your command line so Eclipse's preprocessor will behave differently from the one in your compiler)

这篇关于我怎样才能Eclipse来索引code #IFDEF .... #ENDIF内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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