aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-08-13 15:53:07 +0200
committerPierre Ossman <ossman@cendio.se>2024-08-13 15:53:07 +0200
commitcfa4cc7dd223641176488dc3b41a53e6a81dade4 (patch)
treed96b28c6048450e8a6228ea397fcb56b4b2c0208 /common/rfb
parent92056dc8f4895524f999bb585de461f52f2dffe6 (diff)
downloadtigervnc-cfa4cc7dd223641176488dc3b41a53e6a81dade4.tar.gz
tigervnc-cfa4cc7dd223641176488dc3b41a53e6a81dade4.zip
Use proper gnutls_free() on Windows
The underlying issue requiring this hack was fixed ages ago. Unfortunately, the fixed GnuTLS doesn't consider static linking. So we need to add a new hack that permits that.
Diffstat (limited to 'common/rfb')
-rw-r--r--common/rfb/CMakeLists.txt4
-rw-r--r--common/rfb/CSecurityTLS.cxx10
2 files changed, 4 insertions, 10 deletions
diff --git a/common/rfb/CMakeLists.txt b/common/rfb/CMakeLists.txt
index d7fb3f3a..36535448 100644
--- a/common/rfb/CMakeLists.txt
+++ b/common/rfb/CMakeLists.txt
@@ -100,6 +100,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 eca1ea74..2a7a1179 100644
--- a/common/rfb/CSecurityTLS.cxx
+++ b/common/rfb/CSecurityTLS.cxx
@@ -47,16 +47,6 @@
#include <gnutls/x509.h>
-/*
- * 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);