0
我工作的定義是這樣全局的一個項目:用Eclipse中的不同定義替換宏?
// Define an correctly-sized array of pointers to avoid static initialization.
// Use an array of pointers instead of an array of char in case there is some alignment issue.
#define DEFINE_GLOBAL(type, name, ...) \
void * name[(sizeof(type) + sizeof(void *) - 1)/sizeof(void *)];
這顯然能正常工作,但會導致Eclipse來顯示這些全局變量爲錯誤之一的每一個使用。
,我寧願它是這樣的:
#define DEFINE_GLOBAL(type, name, ...) \
type name;
但我不能改變這個文件,那麼,有沒有辦法告訴Eclipse來假裝這是宏的定義是什麼?