diff --git a/common/rfb/CMakeLists.txt b/common/rfb/CMakeLists.txt index 360434a9f..b67d1932c 100644 --- a/common/rfb/CMakeLists.txt +++ b/common/rfb/CMakeLists.txt @@ -101,6 +101,10 @@ if(GNUTLS_FOUND) target_sources(rfb PRIVATE CSecurityTLS.cxx SSecurityTLS.cxx) target_include_directories(rfb SYSTEM PUBLIC ${GNUTLS_INCLUDE_DIR}) target_link_libraries(rfb ${GNUTLS_LIBRARIES}) + # FIXME: Hack to block it marking gnutls_free() as dllimport + if(WIN32 AND BUILD_STATIC) + target_compile_definitions(rfb PRIVATE GNUTLS_INTERNAL_BUILD) + endif() endif() if (NETTLE_FOUND) diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx index 11e6dfe3b..9a6489387 100644 --- a/common/rfb/CSecurityTLS.cxx +++ b/common/rfb/CSecurityTLS.cxx @@ -46,16 +46,6 @@ #include -/* - * GNUTLS doesn't correctly export gnutls_free symbol which is - * a function pointer. Linking with Visual Studio 2008 Express will - * fail when you call gnutls_free(). - */ -#if WIN32 -#undef gnutls_free -#define gnutls_free free -#endif - using namespace rfb; static const char* configdirfn(const char* fn);