> Date: Mon, 05 Jan 2015 16:40:15 +0000
> From: Gisle Vanem <[email protected]>
> 
> 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);
> +}

Do we still want to support the older Windows NT4 and 9X versions?  If
so, we should try loading Rpcrt4.dll dynamically, with LoadLibrary,
and if that fails, fall back on the current code.

Thanks.

Reply via email to