From: Nikos Mavrogiannopoulos Date: Thu, 31 Jul 2014 10:18:16 +0000 (+0200) Subject: several windows compilation fixes X-Git-Tag: gnutls_3_4_0~1162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88b97ff3962d94e56764c334a71fa2f82815a096;p=thirdparty%2Fgnutls.git several windows compilation fixes --- diff --git a/lib/atfork.h b/lib/atfork.h index cf299ab636..dfb682bd90 100644 --- a/lib/atfork.h +++ b/lib/atfork.h @@ -68,7 +68,7 @@ unsigned _gnutls_fork_detected(unsigned int *v) # endif #else /* _WIN32 */ -# define _gnutls_fork_set_val() 0 +# define _gnutls_fork_set_val(x) 0 # define _gnutls_register_fork_handler() 0 # define _gnutls_fork_detected(x) 0 #endif diff --git a/lib/nettle/rnd-common.c b/lib/nettle/rnd-common.c index 3bdfdbd8b5..0a015d5aa0 100644 --- a/lib/nettle/rnd-common.c +++ b/lib/nettle/rnd-common.c @@ -80,6 +80,7 @@ void _rnd_get_event(struct event_st *e) static HCRYPTPROV device_fd = 0; +static int _rnd_get_system_entropy_win32(void* rnd, size_t size) { if (!CryptGenRandom(device_fd, (DWORD) size, rnd)) { diff --git a/lib/system.h b/lib/system.h index 0e7bcfbcc8..0a7350e444 100644 --- a/lib/system.h +++ b/lib/system.h @@ -98,8 +98,9 @@ int _gnutls_ucs2_to_utf8(const void *data, size_t size, int gnutls_system_global_init(void); void gnutls_system_global_deinit(void); -#include -#ifdef _WIN32 +#ifndef _WIN32 +# include +#else # define inet_aton _gnutls_inet_aton int inet_aton(const char *cp, struct in_addr *inp); #endif diff --git a/lib/x509/verify-high2.c b/lib/x509/verify-high2.c index ec55f385e3..fd90a99c05 100644 --- a/lib/x509/verify-high2.c +++ b/lib/x509/verify-high2.c @@ -304,7 +304,11 @@ int load_dir_certs(const char *dirname, if (dirp != NULL) { do { d = readdir(dirp); - if (d != NULL && d->d_type == DT_REG) { + if (d != NULL +#ifndef _WIN32 + && d->d_type == DT_REG +#endif + ) { snprintf(path, sizeof(path), "%s/%s", dirname, d->d_name);