_HAS_ITERATOR_DEBUGGING=0
取消该宏定义。我擦,这是什么骚操作,还行这么玩,一看就感觉有问题,结果为了证明这样是取消不了该宏的定义的,特此进行了一下验证;#ifdef _HAS_ITERATOR_DEBUGGING
#define x_1 1
#pragma message ("#define x_1 1")
#endif
#ifdef _HAS_ITERATOR_DEBUGGING
#define y_1 1
#pragma message ("#define y_1 1")
#endif
#include
int main()
{
//int x = 0;
#ifdef _HAS_ITERATOR_DEBUGGING
{
printf("#ifdef _HAS_ITERATOR_DEBUGGING\n");
printf("x_z = %d\n", _HAS_ITERATOR_DEBUGGING);
printf("x_1 = %d\n", x_1);
printf("y_1 = %d\n", y_1);
}
#endif
if (_HAS_ITERATOR_DEBUGGING == 0)
{
printf("if (_HAS_ITERATOR_DEBUGGING == 0)\n");
printf("x_z = %d\n", _HAS_ITERATOR_DEBUGGING);
printf("x_1 = %d\n", x_1);
printf("y_1 = %d\n", y_1);
}
if (_HAS_ITERATOR_DEBUGGING == 1)
{
printf("if (_HAS_ITERATOR_DEBUGGING == 1)\n");
printf("x_z = %d\n", _HAS_ITERATOR_DEBUGGING);
printf("x_1 = %d\n", x_1);
printf("y_1 = %d\n", y_1);
}
if (_HAS_ITERATOR_DEBUGGING == 2)
{
printf("if (_HAS_ITERATOR_DEBUGGING == 2)\n");
printf("x_z = %d\n", _HAS_ITERATOR_DEBUGGING);
printf("x_1 = %d\n", x_1);
printf("y_1 = %d\n", y_1);
}
// printf("%d\n", vtkBooleanMacro(x,=,1));
std::cout << "Hello World!\n";
getchar();
}
_HAS_ITERATOR_DEBUGGING=0
_HAS_ITERATOR_DEBUGGING 为 0
,但是该 _HAS_ITERATOR_DEBUGGING
还是属于被预定义状态;#ifdef _HAS_ITERATOR_DEBUGGING
判断已经被预定义,或者使用if(_HAS_ITERATOR_DEBUGGING == 0/1)
这种骚操作很少,起不到取消该_HAS_ITERATOR_DEBUGGING
的定义_HAS_ITERATOR_DEBUGGING=1
_HAS_ITERATOR_DEBUGGING 为 1
,但是该 _HAS_ITERATOR_DEBUGGING
还是属于被预定义状态;_HAS_ITERATOR_DEBUGGING=2
_HAS_ITERATOR_DEBUGGING
宏,即编辑器在编辑阶段便会定义该宏。一般不会再对该宏执行=赋值操作
(应该是认知错误,想取消该宏的定义);if(_HAS_ITERATOR_DEBUGGING == xxxx)
等形式进行判断,#ifdef _HAS_ITERATOR_DEBUGGING
永远都是有效的,被预定义的宏;_HAS_ITERATOR_DEBUGGING=0
是起不到取消宏定义作用的;真的想取消还是要去除该宏的配置;