aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-03-20 17:35:41 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-03-20 17:46:14 +0100
commite678bd4b4289e536e998057bf9a9cf415f21b74c (patch)
tree7be54c8f5020841d44ccc4eaa137f169d358da48 /include
parent723019f727ce53b392389bdadcc1701ae47e6a14 (diff)
Add libcompat fallback implementation for fnmatch
This has basically been copied over from Musl and slightly modifed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/compat.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/compat.h b/include/compat.h
index 111168f..e5785d3 100644
--- a/include/compat.h
+++ b/include/compat.h
@@ -8,6 +8,7 @@
#define COMPAT_H
#include "sqfs/predef.h"
+#include "config.h"
#if defined(__GNUC__) && __GNUC__ >= 5
# define SZ_ADD_OV __builtin_add_overflow
@@ -188,4 +189,15 @@ int getsubopt(char **opt, char *const *keys, char **val);
WCHAR *path_to_windows(const char *input);
#endif
+#ifdef HAVE_FNMATCH
+#include <fnmatch.h>
+#else
+#define FNM_PATHNAME 0x1
+
+#define FNM_NOMATCH 1
+#define FNM_NOSYS (-1)
+
+int fnmatch(const char *, const char *, int);
+#endif
+
#endif /* COMPAT_H */