From 4b2f682f9d34068b71ad12746150158185c4d288 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Tue, 3 Mar 2015 19:45:49 +0100 Subject: [PATCH] Issue #105: workaround for i2v() taking either a const or a non-const method. --- .../security/cert/openssl/X509Certificate_OpenSSL.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vmime/security/cert/openssl/X509Certificate_OpenSSL.cpp b/src/vmime/security/cert/openssl/X509Certificate_OpenSSL.cpp index b187ae7a..abdfb95b 100644 --- a/src/vmime/security/cert/openssl/X509Certificate_OpenSSL.cpp +++ b/src/vmime/security/cert/openssl/X509Certificate_OpenSSL.cpp @@ -123,6 +123,15 @@ struct OpenSSLX509CertificateInternalData X509* cert; }; + +// Workaround for i2v() taking either a const or a non-const 'method' on some platforms +template +STACK_OF(CONF_VALUE)* call_i2v(M m, void* p1, STACK_OF(CONF_VALUE)* p2) +{ + return m->i2v(m, p1, p2); +} + + #endif // VMIME_BUILDING_DOC @@ -409,7 +418,7 @@ bool X509Certificate_OpenSSL::verifyHostName if (extValStr && method->i2v) { - STACK_OF(CONF_VALUE)* val = method->i2v(method, extValStr, NULL); + STACK_OF(CONF_VALUE)* val = call_i2v(method, extValStr, 0); for (int j = 0 ; j < sk_CONF_VALUE_num(val) ; ++j) {