aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-06-14 11:16:00 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-06-14 11:16:00 +0200
commit8d93e692ee21fe73be586df912e2e77d20c34c93 (patch)
tree2a52b9fd880ae7efa41c391b1f74057705446565
parent4c14d72508adf31b4d0f066b047c74a4ab1fccee (diff)
downloadosc.lv2-8d93e692ee21fe73be586df912e2e77d20c34c93.tar.xz
ignore missing FNM_EXTMATCH definition on darwin.
-rw-r--r--VERSION2
-rw-r--r--meson.build2
-rw-r--r--osc.lv2/util.h8
3 files changed, 10 insertions, 2 deletions
diff --git a/VERSION b/VERSION
index 2c88ab2..5076ee8 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.123
+0.1.125
diff --git a/meson.build b/meson.build
index bf1a51d..750f0dc 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@ project('osc.lv2', 'c', default_options : [
'warning_level=3',
'werror=true',
'b_lto=false',
- 'c_std=gnu11'])
+ 'c_std=c11'])
version = run_command('cat', 'VERSION').stdout().strip()
diff --git a/osc.lv2/util.h b/osc.lv2/util.h
index 86d38ad..ec4cf00 100644
--- a/osc.lv2/util.h
+++ b/osc.lv2/util.h
@@ -75,6 +75,7 @@ lv2_osc_pattern_match(const char *from, const char *name, size_t len)
{
size_t nbrace = 0;
+#if defined(FNM_EXTMATCH)
// count opening curly braces
for(size_t i = 0; i < len; i++)
{
@@ -83,6 +84,7 @@ lv2_osc_pattern_match(const char *from, const char *name, size_t len)
nbrace++;
}
}
+#endif
// allocate temporary pattern buffer
char *pattern = alloca(len + nbrace + 1);
@@ -92,6 +94,7 @@ lv2_osc_pattern_match(const char *from, const char *name, size_t len)
return false;
}
+#if defined(FNM_EXTMATCH)
// convert {x,y} to @(x|y) for extended fnmatch
if(nbrace)
{
@@ -122,6 +125,7 @@ lv2_osc_pattern_match(const char *from, const char *name, size_t len)
}
}
else
+#endif
{
memcpy(pattern, from, len);
}
@@ -129,7 +133,11 @@ lv2_osc_pattern_match(const char *from, const char *name, size_t len)
// terminate pattern string with null terminator
pattern[len + nbrace] = '\0';
+#if defined(FNM_EXTMATCH)
return fnmatch(pattern, name, FNM_NOESCAPE | FNM_EXTMATCH) == 0 ? true : false;
+#else
+ return fnmatch(pattern, name, FNM_NOESCAPE) == 0 ? true : false;
+#endif
}
static void