[gnutls-devel] GnuTLS | Fails to build with clang on Windows (gettime conflict) (#1497)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Tue Aug 15 13:58:05 CEST 2023




Christoph Reiter commented: https://gitlab.com/gnutls/gnutls/-/issues/1497#note_1513866196

I've worked this around now downstream, by just dropping that conflicting declaration:

```diff
--- gnutls-3.8.1/src/benchmark.h.orig	2023-08-15 12:08:01.059509200 +0200
+++ gnutls-3.8.1/src/benchmark.h	2023-08-15 12:10:19.840993900 +0200
@@ -31,19 +31,6 @@
 #include <stdint.h>
 #include "timespec.h"
 
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
-#undef gettime
-#define gettime(x) clock_gettime(CLOCK_PROCESS_CPUTIME_ID, x)
-#else
-inline static void gettime(struct timespec *ts)
-{
-	struct timeval tv;
-	gettimeofday(&tv, NULL);
-	ts->tv_sec = tv.tv_sec;
-	ts->tv_nsec = tv.tv_usec * 1000;
-}
-#endif
-
 typedef void (*sighandler_t)(int);
 
 void benchmark_cipher(int debug_level);
```

though the gnulib variant doesn't use CLOCK_PROCESS_CPUTIME_ID, so it's not 100% equivalent. https://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/gettime.c

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1497#note_1513866196
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20230815/890741da/attachment.html>


More information about the Gnutls-devel mailing list