MSVC 中的多通道预处理器?

Multipass preprocessor in MSVC?

我有代码:

#define __IGNORE__(...)
#define XUJ(x) ); if (x) { test2(); } __IGNORE__(0

void test2() {

}

void test() {

}

int main() {
    int x = 0;
    test(XUJ(x));
    return 0;
}

GCC 编译,但是 cl.exe 有错误:

$ cl 1.cpp
1.cpp(14): error C2059: syntax error: ;

但是...如果我将宏解压为:

test(); if (x) { test2(); } __IGNORE__(0);

编译正常。 MSVC 2015 编译器不支持多通道预处理器? O_O

更新: 嗯....大括号在哪里? o_O

$ cl /E 1.cpp

1.cpp
#line 1 "1.cpp"



    void test2() {

    }

    void test() {

    }

    int main() {
        int x = 0;
        test(); if (x) { test2(); } ;
        return 0;
    }

这是一个奇怪的 MSVC 错误 -_-

我将 0 移动到宏 - 修复了错误 -_-

#define KEEEK 0
#define __IGNORE__(...)
#define XUJ(x) ); if (x) { test2(); } __IGNORE__(KEEEK

void test2() {

}

void test() {

}

int main() {
    int p = 0;
    test(XUJ(p));
    return 0;
}