From patchwork Fri Feb 1 22:13:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 14410 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9B46623F96 for ; Fri, 1 Feb 2013 22:13:44 +0000 (UTC) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by fiordland.canonical.com (Postfix) with ESMTP id 51C47A18381 for ; Fri, 1 Feb 2013 22:13:44 +0000 (UTC) Received: by mail-ve0-f175.google.com with SMTP id cy12so783094veb.6 for ; Fri, 01 Feb 2013 14:13:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=LUiggO7PTMPNOp+yqkYrBCXaOK/rSlo3PknhDNmHheE=; b=NIYcfj1wrJBdGNP6QRI3eh8tbeo0AqGf7eWWVD6n2moRsV/YIdIK51/0YnBcQMq045 gaXVtlYxSuSi0C14Ruayi9hdmcKg4tDWH/rfCBvInucfJGv9TXwQH7+dC1FWno7cCzbJ iAka3pJSccxSxiHOJ8R/ClYCwoAYAN46sO9sKIEb2N8chhXFbVEGv30R2/6i9Y/2aNsc qCwqB0IfIX6tIco+H98La4KvnN1AO1wzyttyeRPxuuzlQVYOTW/0oXiyk1a1f/cOk9aY 99yNfXKi8HdsTgNY8axnY2Y9W6LuggAbVdxVG0JTxVu4BGZ5jHzRnn/l0+bZ7uKaLhvb hcjQ== X-Received: by 10.52.21.146 with SMTP id v18mr11066433vde.79.1359756823846; Fri, 01 Feb 2013 14:13:43 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.252.8 with SMTP id zo8csp139229vec; Fri, 1 Feb 2013 14:13:43 -0800 (PST) X-Received: by 10.50.193.201 with SMTP id hq9mr117938igc.102.1359756823174; Fri, 01 Feb 2013 14:13:43 -0800 (PST) Received: from mail-ia0-x233.google.com (ia-in-x0233.1e100.net [2607:f8b0:4001:c02::233]) by mx.google.com with ESMTPS id bq4si9020693icc.86.2013.02.01.14.13.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 14:13:43 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:4001:c02::233 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c02::233; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:4001:c02::233 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) smtp.mail=tom.gall@linaro.org Received: by mail-ia0-f179.google.com with SMTP id x24so5934920iak.38 for ; Fri, 01 Feb 2013 14:13:42 -0800 (PST) X-Received: by 10.50.41.165 with SMTP id g5mr160209igl.66.1359756822884; Fri, 01 Feb 2013 14:13:42 -0800 (PST) Received: from mars.mantorvilleexpress.com ([70.35.96.184]) by mx.google.com with ESMTPS id xn10sm3999047igb.4.2013.02.01.14.13.40 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 14:13:41 -0800 (PST) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 2/2] android: add strchrnul to shader_runner.c Date: Fri, 1 Feb 2013 16:13:32 -0600 Message-Id: <1359756812-29545-2-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359756812-29545-1-git-send-email-tom.gall@linaro.org> References: <1359756812-29545-1-git-send-email-tom.gall@linaro.org> X-Gm-Message-State: ALoCoQkOymAq957XXY3UIUtQ4T6JkeJAKP9Zi/6bft2ZGwC0VfwcQxHyv5J/1X03doNJGVnCT7be strchrnul is used in shader_runner.c (and no where else in all of piglit). Unfortunately bionic, Android's c library does not include this function. I've writen an implementation of strchrnul which is only used when compiling for Android. Signed-off-by: Tom Gall --- tests/shaders/shader_runner.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index 20f1ee0..fab7296 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -38,6 +38,26 @@ #include "shader_runner_gles_workarounds.h" +#if defined(__ANDROID__) +/* on Android there is no strchrnul which is used in this test, so we must fill + * in an implementation. + * + * The strchrnul() function is like strchr() except that if c is not found in s, then + * it returns a pointer to the null byte at the end of s, rather than NULL + */ +char * +strchrnul(const char *s, int c) +{ + char * result = strchr(s, c); + + if (result == NULL) { + result = s + strlen(s); + } + + return result; +} +#endif /* __ANDROID__ */ + static void get_required_versions(const char *script_name, struct piglit_gl_test_config *config);