diff options
author | Jehan <jehan@girinstud.io> | 2019-01-07 14:35:21 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2019-03-26 06:15:15 -0400 |
commit | 7640ddc29fb1f7c852162d57d94e606f97f99711 (patch) | |
tree | 29ccad89087cd55cd4b3fb2e0ec94a29b4120bd0 /libappstream-glib/as-app.c | |
parent | 2eb9b8caf9ca22ac914b63f34fea5dd6da6f4e76 (diff) | |
download | appstream-glib-7640ddc29fb1f7c852162d57d94e606f97f99711.tar.gz |
Allow building on Windows
Signed-off-by: Richard Hughes <richard@hughsie.com>
Diffstat (limited to 'libappstream-glib/as-app.c')
-rw-r--r-- | libappstream-glib/as-app.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index 73859d1..bca8bcc 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -21,7 +21,6 @@ #include "config.h" #include <string.h> -#include <fnmatch.h> #include "as-app-private.h" #include "as-bundle-private.h" @@ -44,6 +43,10 @@ #include "as-utils-private.h" #include "as-yaml.h" +#ifndef _WIN32 +#include <fnmatch.h> +#endif + typedef struct { AsAppProblems problems; @@ -6163,8 +6166,8 @@ as_app_parse_appdata_unintltoolize_cb (GNode *node, gpointer data) static void as_app_parse_appdata_guess_project_group (AsApp *app) { +#ifndef _WIN32 const gchar *tmp; - guint i; struct { const gchar *project_group; const gchar *url_glob; @@ -6187,7 +6190,7 @@ as_app_parse_appdata_guess_project_group (AsApp *app) tmp = as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE); if (tmp == NULL) return; - for (i = 0; table[i].project_group != NULL; i++) { + for (guint i = 0; table[i].project_group != NULL; i++) { if (fnmatch (table[i].url_glob, tmp, 0) == 0) { as_app_set_project_group (app, table[i].project_group); return; @@ -6200,16 +6203,21 @@ as_app_parse_appdata_guess_project_group (AsApp *app) as_app_set_project_group (AS_APP (app), "KDE"); return; } +#endif } static int as_utils_fnmatch (const gchar *pattern, const gchar *text, gsize text_sz, gint flags) { +#ifndef _WIN32 if (text_sz != -1 && text[text_sz-1] != '\0') { g_autofree gchar *text_with_nul = g_strndup (text, text_sz); return fnmatch (pattern, text_with_nul, flags); } return fnmatch (pattern, text, flags); +#else + return 1; +#endif } /** |