diff options
Diffstat (limited to 'libappstream-glib/as-utils.c')
-rw-r--r-- | libappstream-glib/as-utils.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c index dd71f02..6cd1c3c 100644 --- a/libappstream-glib/as-utils.c +++ b/libappstream-glib/as-utils.c @@ -18,13 +18,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> @@ -1526,6 +1527,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]; @@ -1565,6 +1573,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 } /** @@ -1580,12 +1589,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 } /** |