Gisle Vanem wrote:

And for Windows? I guess the 'UuidCreate()' or 'UuidCreateSequential()'
functions from Rpcrt4.dll could be used?

I could write a patch for loading Rpcrt4.dll at run-time if
there's some interest.

Done that now. It was simple enough:

--- Git-latest/src/warc.c    2014-12-28 18:03:37 +0000
+++ src/warc.c      2014-12-28 18:11:48 +0000
@@ -61,6 +61,7 @@
 #ifdef WINDOWS
 /* we need this on Windows to have O_TEMPORARY defined */
 #include <fcntl.h>
+#include <rpc.h>
 #endif

 #ifndef O_TEMPORARY
@@ -631,6 +632,18 @@
   sprintf (urn_str, "<urn:uuid:%s>", uuid_str);
   xfree (uuid_str);
 }
+#elif defined(WINDOWS)
+void
+warc_uuid_str (char *urn_str)
+{
+  BYTE *uuid_str;
+  UUID  uuid;
+
+  UuidCreate (&uuid);
+  UuidToString (&uuid, &uuid_str);
+  sprintf (urn_str, "<urn:uuid:%s>", uuid_str);
+  RpcStringFree (&uuid_str);
+}
 #else
 /* Fills urn_str with a UUID based on random numbers in the format
    required for the WARC-Record-Id header.

--------

But I have no idea to specify '-lrpcrt4' or 'rpcrt4.lib' to LDADD
conditionally for Win32. Like so?

+
+if WIN32
+  LDADD += -lrpcrt4
+endif
+

--
--gv

Reply via email to