summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2012-06-12 17:42:25 +0300
committerKristian Høgsberg <krh@bitplanet.net>2012-06-12 12:29:13 -0400
commitb7a9498a8eb29e2d9f9279b64d66683a222aebc7 (patch)
tree1944899f41802f9d3311f5cff7ef6ec38174077c /shared
parentb79b63531222352b91137b978fe552e0e8091cdf (diff)
downloadweston-b7a9498a8eb29e2d9f9279b64d66683a222aebc7.tar.gz
compositor: add fallback strchrnul()
Android does not have this function. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Diffstat (limited to 'shared')
-rw-r--r--shared/os-compatibility.c10
-rw-r--r--shared/os-compatibility.h5
2 files changed, 15 insertions, 0 deletions
diff --git a/shared/os-compatibility.c b/shared/os-compatibility.c
index 66934a8c..21d4d029 100644
--- a/shared/os-compatibility.c
+++ b/shared/os-compatibility.c
@@ -168,3 +168,13 @@ os_create_anonymous_file(off_t size)
return fd;
}
+
+#ifndef HAVE_STRCHRNUL
+char *
+strchrnul(const char *s, int c)
+{
+ while (*s && *s != c)
+ s++;
+ return (char *)s;
+}
+#endif
diff --git a/shared/os-compatibility.h b/shared/os-compatibility.h
index b2021f11..c1edcfbd 100644
--- a/shared/os-compatibility.h
+++ b/shared/os-compatibility.h
@@ -46,4 +46,9 @@ os_epoll_create_cloexec(void);
int
os_create_anonymous_file(off_t size);
+#ifndef HAVE_STRCHRNUL
+char *
+strchrnul(const char *s, int c);
+#endif
+
#endif /* OS_COMPATIBILITY_H */