[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [patch] uuid generation in warc.c
From: |
Gisle Vanem |
Subject: |
Re: [Bug-wget] [patch] uuid generation in warc.c |
Date: |
Mon, 05 Jan 2015 16:40:15 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 SeaMonkey/2.31 |
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
- Re: [Bug-wget] [patch] uuid generation in warc.c,
Gisle Vanem <=