summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-07-25 16:26:39 +0200
committerGitLab <gitlab@gitlab.com>2016-07-26 16:26:14 +0000
commitef861381871a77719aac292d7ac3ee6a961b53cc (patch)
treebbbf60eaebcc6fa3479696f63b5b7c6e5556b753
parent972bf4d69187fa940e039180fc4bdb7eaeee4f62 (diff)
downloadgnutls-ef861381871a77719aac292d7ac3ee6a961b53cc.tar.gz
gnutls.h: giovec_t is a typedef to iovec where that is available
-rw-r--r--configure.ac16
-rw-r--r--lib/includes/gnutls/gnutls.h.in5
2 files changed, 17 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index c31b102b18..8175759d6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,6 +160,22 @@ esac
fi
+dnl Check for iovec type
+AC_CHECK_MEMBERS([struct iovec.iov_basea],
+ [
+ AC_SUBST([DEFINE_IOVEC_T], ["#include <sys/uio.h>
+typedef struct iovec giovec_t;"])
+ ],
+ [
+ AC_SUBST([DEFINE_IOVEC_T], ["typedef struct {
+ void *iov_base;
+ size_t iov_len;
+} giovec_t;"])
+ ],
+ [#include <sys/uio.h>
+ ])
+AM_SUBST_NOTMAKE([DEFINE_IOVEC_T])
+
dnl Need netinet/tcp.h for TCP_FASTOPEN
AC_CHECK_HEADERS([netinet/tcp.h])
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index 5778d4a2ec..cfe28aac78 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -1861,10 +1861,7 @@ int gnutls_dh_params_cpy(gnutls_dh_params_t dst, gnutls_dh_params_t src);
/* Session stuff
*/
-typedef struct {
- void *iov_base; /* Starting address */
- size_t iov_len; /* Number of bytes to transfer */
-} giovec_t;
+@DEFINE_IOVEC_T@
typedef ssize_t(*gnutls_pull_func) (gnutls_transport_ptr_t, void *,
size_t);