Author: jgardou Date: Mon Sep 1 12:00:20 2014 New Revision: 64021
URL: http://svn.reactos.org/svn/reactos?rev=64021&view=rev Log: [SCHANNEL] - Uglier but (hopefully) functioning hack for Visual Studio compilers
Added: trunk/reactos/dll/win32/schannel/msvc_typeof_hack.h (with props) Modified: trunk/reactos/dll/win32/schannel/schannel_gnutls.c
Added: trunk/reactos/dll/win32/schannel/msvc_typeof_hack.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/schannel/msvc_typ... ============================================================================== --- trunk/reactos/dll/win32/schannel/msvc_typeof_hack.h (added) +++ trunk/reactos/dll/win32/schannel/msvc_typeof_hack.h [iso-8859-1] Mon Sep 1 12:00:20 2014 @@ -0,0 +1,48 @@ + +#pragma once + +#define typeof(_X) __typeof_ ## _X + +typedef gnutls_alert_description_t (__cdecl typeof(gnutls_alert_get))(gnutls_session_t session); +typedef const char* (__cdecl typeof(gnutls_alert_get_name))(gnutls_alert_description_t alert); +typedef void (__cdecl typeof(gnutls_certificate_free_credentials))(gnutls_certificate_credentials_t sc); +typedef int (__cdecl typeof(gnutls_certificate_allocate_credentials))(gnutls_certificate_credentials_t + * res); +typedef const gnutls_datum_t* (__cdecl typeof(gnutls_certificate_get_peers))(gnutls_session_t + session, unsigned int + *list_size); +typedef gnutls_cipher_algorithm_t (__cdecl typeof(gnutls_cipher_get))(gnutls_session_t session); +typedef size_t (__cdecl typeof(gnutls_cipher_get_key_size))(gnutls_cipher_algorithm_t algorithm); +typedef int (__cdecl typeof(gnutls_credentials_set))(gnutls_session_t session, + gnutls_credentials_type_t type, void *cred); +typedef void (__cdecl typeof(gnutls_deinit))(gnutls_session_t session); +typedef int (__cdecl typeof(gnutls_global_init))(void); +typedef void (__cdecl typeof(gnutls_global_deinit))(void); +typedef void (__cdecl typeof(gnutls_global_set_log_function))(gnutls_log_func log_func); +typedef void (__cdecl typeof(gnutls_global_set_log_level))(int level); +typedef int (__cdecl typeof(gnutls_handshake))(gnutls_session_t session); +typedef int (__cdecl typeof(gnutls_init))(gnutls_session_t * session, unsigned int flags); +typedef gnutls_kx_algorithm_t (__cdecl typeof(gnutls_kx_get))(gnutls_session_t session); +typedef gnutls_mac_algorithm_t (__cdecl typeof(gnutls_mac_get))(gnutls_session_t session); +typedef size_t (__cdecl typeof(gnutls_mac_get_key_size))(gnutls_mac_algorithm_t algorithm); +typedef void (__cdecl typeof(gnutls_perror))(int error); +typedef gnutls_protocol_t (__cdecl typeof(gnutls_protocol_get_version))(gnutls_session_t session); +typedef int (__cdecl typeof(gnutls_priority_set_direct))(gnutls_session_t session, + const char *priorities, + const char **err_pos); +typedef size_t (__cdecl typeof(gnutls_record_get_max_size))(gnutls_session_t session); +typedef ssize_t (__cdecl typeof(gnutls_record_recv))(gnutls_session_t session, void *data, + size_t data_size); +typedef ssize_t (__cdecl typeof(gnutls_record_send))(gnutls_session_t session, const void *data, + size_t data_size); +typedef int (__cdecl typeof(gnutls_server_name_set))(gnutls_session_t session, + gnutls_server_name_type_t type, + const void *name, size_t name_length); +typedef gnutls_transport_ptr_t (__cdecl typeof(gnutls_transport_get_ptr))(gnutls_session_t session); +typedef void (__cdecl typeof(gnutls_transport_set_errno))(gnutls_session_t session, int err); +typedef void (__cdecl typeof(gnutls_transport_set_ptr))(gnutls_session_t session, + gnutls_transport_ptr_t ptr); +typedef void (__cdecl typeof(gnutls_transport_set_push_function))(gnutls_session_t session, + gnutls_push_func push_func); +typedef void (__cdecl typeof(gnutls_transport_set_pull_function))(gnutls_session_t session, + gnutls_pull_func pull_func);
Propchange: trunk/reactos/dll/win32/schannel/msvc_typeof_hack.h ------------------------------------------------------------------------------ charset = UTF-8
Propchange: trunk/reactos/dll/win32/schannel/msvc_typeof_hack.h ------------------------------------------------------------------------------ svn:eol-style = native
Propchange: trunk/reactos/dll/win32/schannel/msvc_typeof_hack.h ------------------------------------------------------------------------------ svn:mime-type = text/plain
Modified: trunk/reactos/dll/win32/schannel/schannel_gnutls.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/schannel/schannel... ============================================================================== --- trunk/reactos/dll/win32/schannel/schannel_gnutls.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/schannel/schannel_gnutls.c [iso-8859-1] Mon Sep 1 12:00:20 2014 @@ -35,11 +35,12 @@ #if defined(SONAME_LIBGNUTLS) && !defined(HAVE_SECURITY_SECURITY_H)
static void *libgnutls_handle; -#if (_MSC_VER >= 1600) -#define MAKE_FUNCPTR(f) static decltype(f) p##f -#else + +#ifdef _MSC_VER +#include "msvc_typeof_hack.h" +#endif + #define MAKE_FUNCPTR(f) static typeof(f) * p##f -#endif MAKE_FUNCPTR(gnutls_alert_get); MAKE_FUNCPTR(gnutls_alert_get_name); MAKE_FUNCPTR(gnutls_certificate_allocate_credentials);