From 40c44dfea1fd283af8340419f4dc313b57bee820 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 8 Oct 2010 14:57:40 +0000 Subject: [PATCH] for w32 port --- src/include/gnunet_network_lib.h | 13 +++++++++++++ src/util/network.c | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index a5ae0e4e6..73303689a 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h @@ -271,6 +271,19 @@ void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, const struct GNUNET_NETWORK_Handle *desc); +#ifdef __MINGW32__ +/* TODO: maybe #ifdef WINDOWS? -ndurner */ +/** + * Add a W32 file handle to the fd set + * @param fds fd set + * @param h the file handle to add + */ +void +GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds, + HANDLE h); +#endif + + /** * Check whether a socket is part of the fd set * @param fds fd set diff --git a/src/util/network.c b/src/util/network.c index 2f3ac43b2..cf74d43ad 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -852,6 +852,23 @@ GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, } +#if MINGW +/** + * Add a W32 file handle to the fd set + * @param fds fd set + * @param h the file handle to add + */ +void +GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds, + HANDLE h) +{ + GNUNET_CONTAINER_slist_add (fds->handles, + GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT, + &h, sizeof (HANDLE)); +} +#endif + + /** * Check if a file handle is part of an fd set * @param fds fd set -- 2.25.1