From patchwork Fri Feb 1 22:10:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 14406 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 C256F23F96 for ; Fri, 1 Feb 2013 22:10:33 +0000 (UTC) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by fiordland.canonical.com (Postfix) with ESMTP id 7F509A18381 for ; Fri, 1 Feb 2013 22:10:33 +0000 (UTC) Received: by mail-vb0-f53.google.com with SMTP id fj18so2761772vbb.12 for ; Fri, 01 Feb 2013 14:10:33 -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=MQwUFmJ+4bcIPdtYcf9b1s1sLiOal612SQYdo8uTEKocXhZGC4Iu7cvlFgKX7cIodK Y99eTUaVWnmz4cVJj0WnfLFDs6hXHOqVhKxssRwqhras3LcdNDaG/2lxL0KmtsOSvpU0 RDme8KE+K0N3zJoB+COmugQ1FXp0KCFqJy+/OOPUmae0nMiZb7JxzcmtCwGn1LNcN34V ws2Tj/B6ZkJe4kqbW8b0lj+9vJa3rGLT0MXJfW2swWQygUt2Up7WawdxicWzhbRLkiVQ f1RAfYtVQvVvhVhFSZBGNhSEBVZ7k11luAEWab5+mU1fYZ4+53jIyvui36dKFHvGv8cj a2MA== X-Received: by 10.220.219.77 with SMTP id ht13mr12556256vcb.66.1359756633014; Fri, 01 Feb 2013 14:10:33 -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 zo8csp139110vec; Fri, 1 Feb 2013 14:10:32 -0800 (PST) X-Received: by 10.50.190.138 with SMTP id gq10mr188020igc.38.1359756632277; Fri, 01 Feb 2013 14:10:32 -0800 (PST) Received: from mail-ia0-x22f.google.com (ia-in-x022f.1e100.net [2607:f8b0:4001:c02::22f]) by mx.google.com with ESMTPS id bs4si1571996icc.80.2013.02.01.14.10.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 14:10:32 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:4001:c02::22f is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c02::22f; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:4001:c02::22f 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-f175.google.com with SMTP id r4so5869237iaj.20 for ; Fri, 01 Feb 2013 14:10:32 -0800 (PST) X-Received: by 10.50.163.7 with SMTP id ye7mr202840igb.18.1359756632005; Fri, 01 Feb 2013 14:10:32 -0800 (PST) Received: from mars.mantorvilleexpress.com ([70.35.96.184]) by mx.google.com with ESMTPS id mj6sm3967035igc.9.2013.02.01.14.10.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 14:10:31 -0800 (PST) From: Tom Gall To: piglit@lists.linaro.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 2/2] android: add strchrnul to shader_runner.c Date: Fri, 1 Feb 2013 16:10:16 -0600 Message-Id: <1359756616-29412-2-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359756616-29412-1-git-send-email-tom.gall@linaro.org> References: <1359756616-29412-1-git-send-email-tom.gall@linaro.org> X-Gm-Message-State: ALoCoQmvv5kshfMRD8rGdmdzJkEEP1KO+YHSOklC7q1TtI3OafhVdasGpZ5L9U2Un0B7HXSlbY3R 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);