Chuyu-Team / YY-Thunks

Fix DecodePointer, EncodePointer,RegDeleteKeyEx etc. APIs not found in Windows XP RTM.
MIT License
496 stars 102 forks source link

恢复对c++20的兼容 #82

Closed sonyps5201314 closed 1 month ago

sonyps5201314 commented 1 month ago
// ConsoleApplication1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <windows.h>

struct BCryptAlgorithm
{
    DWORD uCryptMode = 0;
    DWORD uEffectiveKeyBitCount = 0;
    BCryptAlgorithm()
    {

    }
};

template<typename BCryptAlgorithmType>
struct BCryptAlgorithmByCryptoAPI : BCryptAlgorithm
{
    BCryptAlgorithmByCryptoAPI()
    {

    }
};

template<typename BCryptAlgorithmType, typename BCryptKeyType, DWORD kDefaultCryptMode, DWORD kDefaultBlockSize>
struct BCryptKeyAlgorithm : public BCryptAlgorithmByCryptoAPI<BCryptAlgorithmType>
{
    BCryptKeyAlgorithm()
    {
        uCryptMode = 0;
    }
};

int main()
{

}

提取报错的代码,发现在gcc中即使指定c++14也会报错: image

clang时指定c++14时不会报错,但是指定c++20时会有警告: image

vc的报错: image

mingkuang-Chuyu commented 1 month ago

@sonyps5201314 YY-Thunk没有在GCC或者clang上编译的需求或者C++20支持需求。这个提交我就关闭了,不过部分缺失是问题,我会接受你的意见。

mingkuang-Chuyu commented 1 month ago

https://github.com/Chuyu-Team/YY-Thunks/commit/45f19fa44af9176a0ff90535b868261051117304

已经重新提交,问题我会接受,但是YY-Thunks没有兼容C++20编译需求,任然建议你使用相同的编译参数编译YY-Thunks。