From patchwork Fri Feb 1 22:12:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 14408 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 D96DA23F96 for ; Fri, 1 Feb 2013 22:12:16 +0000 (UTC) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id 94495A1822E for ; Fri, 1 Feb 2013 22:12:16 +0000 (UTC) Received: by mail-vc0-f180.google.com with SMTP id fo13so2745704vcb.39 for ; Fri, 01 Feb 2013 14:12:16 -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=Ed1O2MEC5tHcG8tevSu78pe0REwlo+RppqoSvkKitry7CbmzePtCH7tQ599WsrvTWr Ir7jCxafRBRQ2+nc/Foedl1ASIcy0LbJaArjVrIGsBt6tMqoPDKvOdrnDMek4S4toFGZ 3st2XIpBhuaBa7BQ7IVBlnRSA2YgOXeYp5Q+BJ3nV7b4dgEBBYA3ZcuUiiA3ZxZSFg+7 m24sAqA8ckjdNZEl7zG9MDw3G/9XrQW1XkmVhdtTdSDWpDgLqW94eQAJHkK7i3iVcPQF GkYTWCAEMH3YjIb8Pzkpy9BAAbcn+mBPHrRYziN1po83aF6BIBU6pHC6x5LlD3K2Q8tC SZrA== X-Received: by 10.58.232.226 with SMTP id tr2mr8585217vec.48.1359756736047; Fri, 01 Feb 2013 14:12:16 -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 zo8csp139171vec; Fri, 1 Feb 2013 14:12:15 -0800 (PST) X-Received: by 10.50.41.197 with SMTP id h5mr149944igl.70.1359756735233; Fri, 01 Feb 2013 14:12:15 -0800 (PST) Received: from mail-ie0-x229.google.com (ie-in-x0229.1e100.net [2607:f8b0:4001:c03::229]) by mx.google.com with ESMTPS id x6si5029321ict.42.2013.02.01.14.12.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 14:12:15 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:4001:c03::229 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c03::229; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:4001:c03::229 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-ie0-f169.google.com with SMTP id 13so1931501iea.14 for ; Fri, 01 Feb 2013 14:12:15 -0800 (PST) X-Received: by 10.50.108.145 with SMTP id hk17mr171670igb.51.1359756734983; Fri, 01 Feb 2013 14:12:14 -0800 (PST) Received: from mars.mantorvilleexpress.com ([70.35.96.184]) by mx.google.com with ESMTPS id fa6sm4371766igb.2.2013.02.01.14.12.13 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 14:12:14 -0800 (PST) From: Tom Gall To: piglit@lists.freedesk.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 2/2] android: add strchrnul to shader_runner.c Date: Fri, 1 Feb 2013 16:12:00 -0600 Message-Id: <1359756720-29476-2-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359756720-29476-1-git-send-email-tom.gall@linaro.org> References: <1359756720-29476-1-git-send-email-tom.gall@linaro.org> X-Gm-Message-State: ALoCoQnru/5RfTApwik3Sa4+RFbAXIY2ZDP7hGtaTl38o/0lDNxuOBCsPepEq76TeHvtpjRCbEDW 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);