summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libappstream-glib/as-utils.c')
-rw-r--r--libappstream-glib/as-utils.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c
index 6f46e52..9c2ae73 100644
--- a/libappstream-glib/as-utils.c
+++ b/libappstream-glib/as-utils.c
@@ -32,13 +32,14 @@
#include "config.h"
-#include <fnmatch.h>
#include <string.h>
#include <archive_entry.h>
#include <archive.h>
#include <libsoup/soup.h>
#include <stdlib.h>
+#ifndef _WIN32
#include <uuid.h>
+#endif
#ifdef HAVE_RPM
#include <rpm/rpmlib.h>
@@ -1540,6 +1541,13 @@ as_utils_guid_from_data (const gchar *namespace_id,
gsize data_len,
GError **error)
{
+#ifdef _WIN32
+ g_set_error_literal (error,
+ AS_UTILS_ERROR,
+ AS_UTILS_ERROR_FAILED,
+ "not supported");
+ return FALSE;
+#else
gchar guid_new[37]; /* 36 plus NUL */
gsize digestlen = 20;
guint8 hash[20];
@@ -1579,6 +1587,7 @@ as_utils_guid_from_data (const gchar *namespace_id,
/* return as a string */
uuid_unparse (uu_new, guid_new);
return g_strdup (guid_new);
+#endif
}
/**
@@ -1594,12 +1603,20 @@ as_utils_guid_from_data (const gchar *namespace_id,
gboolean
as_utils_guid_is_valid (const gchar *guid)
{
+#ifdef _WIN32
+ /* XXX Ideally we should set a GError but this was already a public
+ * API, and it doesn't have such parameter.
+ */
+ g_printerr ("%s: not supported\n", G_STRFUNC);
+ return FALSE;
+#else
gint rc;
uuid_t uu;
if (guid == NULL)
return FALSE;
rc = uuid_parse (guid, uu);
return rc == 0;
+#endif
}
/**