From 2411769962b1c95015bfc2d0c817a34213afbbc9 Mon Sep 17 00:00:00 2001 From: Tobias Junghans Date: Wed, 7 Nov 2018 13:03:16 +0100 Subject: LibVNCServer: properly use thread-local storage The TLS macro never has been defined due to the missing LIBVNCSERVER_HAVE_TLS macro. This revises the macro logic to also cover Win32 builds with MSVC. --- libvncserver/zlib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libvncserver/zlib.c') diff --git a/libvncserver/zlib.c b/libvncserver/zlib.c index 45a1314..6fee4df 100644 --- a/libvncserver/zlib.c +++ b/libvncserver/zlib.c @@ -45,10 +45,11 @@ * tight. N.B. ZRLE does it the traditional way with per-client storage * (and so at least ZRLE will work threaded on older systems.) */ -#if LIBVNCSERVER_HAVE_LIBPTHREAD && LIBVNCSERVER_HAVE_TLS && !defined(TLS) && defined(__linux__) +#if defined(__GNUC__) #define TLS __thread -#endif -#ifndef TLS +#elif defined(_MSC_VER) +#define TLS __declspec(thread) +#else #define TLS #endif -- cgit v1.2.3