enh(cmake): Add option POCO_ENABLE_CPP20 to enable C++20 when compiling Poco (#4956)

* enh(cmake): Add option POCO_CXX20 to enable standard C++20 and related changes.

* chore(cmake): do not allow C++20 setting for compilers that do not support it properly.

* fix(NetSSL_Win): indentation.
This commit is contained in:
Matej Kenda
2025-05-28 15:35:28 +02:00
committed by GitHub
parent 5e5e1a60f9
commit 15d987fbb0
12 changed files with 113 additions and 61 deletions

View File

@@ -174,8 +174,10 @@ void Context::loadCertificate()
}
if (!_hCertStore) throw CertificateException("Failed to open certificate store", _certStoreName, GetLastError());
CERT_RDN_ATTR cert_rdn_attr;
cert_rdn_attr.pszObjId = szOID_COMMON_NAME;
char cmnName[] = szOID_COMMON_NAME;
cert_rdn_attr.pszObjId = cmnName;
cert_rdn_attr.dwValueType = CERT_RDN_ANY_TYPE;
cert_rdn_attr.Value.cbData = (DWORD) _certNameOrPath.size();
cert_rdn_attr.Value.pbData = (BYTE *) _certNameOrPath.c_str();
@@ -270,7 +272,7 @@ void Context::acquireSchannelCredentials(CredHandle& credHandle) const
if (_pCert)
{
schannelCred.cCreds = 1; // how many cred are stored in &pCertContext
schannelCred.paCred = &const_cast<PCCERT_CONTEXT>(_pCert);
schannelCred.paCred = const_cast<PCCERT_CONTEXT*>(&_pCert);
}
schannelCred.grbitEnabledProtocols = proto();
@@ -312,9 +314,10 @@ void Context::acquireSchannelCredentials(CredHandle& credHandle) const
TimeStamp tsExpiry;
tsExpiry.LowPart = tsExpiry.HighPart = 0;
::SEC_WCHAR name[] = UNISP_NAME_W;
SECURITY_STATUS status = _securityFunctions.AcquireCredentialsHandleW(
NULL,
UNISP_NAME_W,
name,
isForServerUse() ? SECPKG_CRED_INBOUND : SECPKG_CRED_OUTBOUND,
NULL,
&schannelCred,

View File

@@ -396,7 +396,8 @@ void X509Certificate::loadCertificate(const std::string& certName, const std::st
if (!hCertStore) throw CertificateException("Failed to open certificate store", certStoreName, GetLastError());
CERT_RDN_ATTR cert_rdn_attr;
cert_rdn_attr.pszObjId = szOID_COMMON_NAME;
char cmnName[] = szOID_COMMON_NAME;
cert_rdn_attr.pszObjId = cmnName;
cert_rdn_attr.dwValueType = CERT_RDN_ANY_TYPE;
cert_rdn_attr.Value.cbData = static_cast<DWORD>(certName.size());
cert_rdn_attr.Value.pbData = reinterpret_cast<BYTE*>(const_cast<char*>(certName.c_str()));