summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_int.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index debd858432..576eaa6786 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -1512,6 +1512,18 @@ unsigned int
/* returns a-b in ms */
timespec_sub_ms(struct timespec *a, struct timespec *b);
+inline static int _gnutls_timespec_cmp(struct timespec *a, struct timespec *b) {
+ if (a->tv_sec < b->tv_sec)
+ return -1;
+ if (a->tv_sec > b->tv_sec)
+ return 1;
+ if (a->tv_nsec < b->tv_nsec)
+ return -1;
+ if (a->tv_nsec > b->tv_nsec)
+ return 1;
+ return 0;
+}
+
#include <algorithms.h>
inline static int _gnutls_set_current_version(gnutls_session_t s, unsigned v)
{