Mingw海湾合作委员会的宏观扩张问题

时间:2015-03-17 23:05:57

标签: c++ gcc c-preprocessor

#define A2W_EX(lpa, nChars) (\
    ((_lpa_ex = lpa) == NULL) ? NULL : (\
        _convert_ex = (lstrlenA(_lpa_ex)+1),\
        FAILED(::ATL::AtlMultiply(&_convert_ex, _convert_ex, static_cast<int>(sizeof(WCHAR)))) ? NULL : \
        ATLA2WHELPER(   \
            (LPWSTR)_ATL_SAFE_ALLOCA(_convert_ex, _ATL_SAFE_ALLOCA_DEF_THRESHOLD), \
            _lpa_ex, \
            _convert_ex / sizeof(WCHAR), \
            _acp_ex)))

我从Visual Studio int MingW复制粘贴一些宏,我收到以下错误

In member function 'ATL::CComVariant& ATL::CComVariant::operator=(LPCSTR)':
C:\.../atlconv.h:635:11: error: expected primary-expression before ')' token
    (LPWSTR)_ATL_SAFE_ALLOCA(_convert_ex, _ATL_SAFE_ALLOCA_DEF_THRESHOLD), \
           ^

有关如何解决此问题的任何建议?

0 个答案:

没有答案