[Mesa-dev] [PATCH 2/5] android: radeonsi: fix building error in si_shader.c

Mauro Rossi issor.oruam at gmail.com
Sat Feb 6 23:55:17 UTC 2016


>From 8030a6cd9d7bb3320fca94038f1969db56223598 Mon Sep 17 00:00:00 2001
From: Mauro Rossi <issor.oruam at gmail.com>
Date: Sat, 6 Feb 2016 23:52:36 +0100
Subject: [PATCH 1/2] android: add support for strchrnul

Android Bionic has no strchrnul in string functions,
radeonsi uses strchrnul, so we need an implementation.

strchrnul.h is added in top mesa include path.
---
 include/strchrnul.h | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 include/strchrnul.h

diff --git a/include/strchrnul.h b/include/strchrnul.h
new file mode 100644
index 0000000..83477e2
--- /dev/null
+++ b/include/strchrnul.h
@@ -0,0 +1,40 @@
+/**************************************************************************
+ *
+ * Copyright (C) 2014 Emil Velikov <emil.l.velikov at gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
"Software"),
+ * to deal in the Software without restriction, including without
limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+
**************************************************************************/
+
+#ifndef _STRCHRNUL_H_
+#define _STRCHRNUL_H_
+
+char *
+strchrnul(const char *s, int c)
+{
+    char * result = strchr(s, c);
+
+    if (result == NULL) {
+        result = s + strlen(s);
+    }
+
+    return result;
+}
+
+#endif /* _STRCHRNUL_H_ */
-- 
2.5.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160207/357bfb45/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-android-add-support-for-strchrnul.patch
Type: text/x-patch
Size: 2231 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160207/357bfb45/attachment.bin>


More information about the mesa-dev mailing list