put gnutls_free fix in DTLSSession header

This commit is contained in:
Stephen Birarda 2014-04-10 12:11:37 -07:00
parent 2c96ce08ae
commit 97444eac1c
2 changed files with 13 additions and 12 deletions

View file

@ -33,17 +33,6 @@ void DTLSClientSession::globalDeinit() {
gnutls_global_deinit();
}
// fix for lnk2001 link error on windows
// call xgnutls_free instead of gnutls_free
// http://stackoverflow.com/questions/14593949/getting-error-lnk2001-unresolved-external-symbol-gnutls-free-when-using-gnut
typedef void (*gnutls_free_function) (void *);
__declspec(dllimport) extern gnutls_free_function gnutls_free;
void xgnutls_free(void* p){
gnutls_free(p);
}
int DTLSClientSession::verifyServerCertificate(gnutls_session_t session) {
unsigned int verifyStatus = 0;
@ -63,7 +52,6 @@ int DTLSClientSession::verifyServerCertificate(gnutls_session_t session) {
gnutls_datum_t printOut;
certReturn = gnutls_certificate_verification_status_print(verifyStatus, typeReturn, &printOut, 0);
if (certReturn < 0) {

View file

@ -19,6 +19,19 @@
#include "DummyDTLSSession.h"
#include "HifiSockAddr.h"
// fix for lnk2001 link error on windows
// call xgnutls_free instead of gnutls_free
// http://stackoverflow.com/questions/14593949/getting-error-lnk2001-unresolved-external-symbol-gnutls-free-when-using-gnut
#ifdef WIN32
typedef void (*gnutls_free_function) (void *);
__declspec(dllimport) extern gnutls_free_function gnutls_free;
#endif
void xgnutls_free(void* gnutlsPtr){
gnutls_free(gnutlsPtr);
}
class DTLSSession : public DummyDTLSSession {
Q_OBJECT
public: