From patchwork Tue Feb 3 16:12:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 44256 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E54C21513 for ; Tue, 3 Feb 2015 16:13:39 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf21646017lab.1 for ; Tue, 03 Feb 2015 08:13:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=9iAQ1Gb9zjAr88rK+Vo4jYtDGci6gNXrGs7KXgNNB6o=; b=ZE/3fMM06putlmKMekUHPwDVD7GlWlS6TkBjWvZb+VW2pvgZWjCpuZSeLWBfgQ7Y5i KYDKNjROfS6L11z5eyY76Qa42c0MG1rw4jmMjbyYtnTSSyr/kHFsxkHkHf+3st3geaPY gJ4V7V/vPqHrVb2HMiu/ZlyfS7fSJ1HHCyP9rT5lzLlj8RoU/QtEBwmOCT3WPvw4UttJ HReDL23aDTlGbB6WAEnPS3RqWeW0cC3cZS3vx2+c3F1U6/EIvzPqkD+Mx9DqD78qp3TR w6XfeqWWQJ6F2EV6NDLAa0JHGwKae/oxGjkC7p7Xpm6o8kERCP5bFASORvNDC7dpaSBT MaeQ== X-Gm-Message-State: ALoCoQkl4dFbw2JIzNDaaKtsX8EWX6+cEkgYfW6NDkxIA4qlHaRZYfy3f5OXJZOO66l+DWXMVJ9L X-Received: by 10.194.178.234 with SMTP id db10mr3239967wjc.2.1422980018398; Tue, 03 Feb 2015 08:13:38 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.193 with SMTP id g1ls705008laf.14.gmail; Tue, 03 Feb 2015 08:13:38 -0800 (PST) X-Received: by 10.112.129.228 with SMTP id nz4mr25152333lbb.8.1422980018220; Tue, 03 Feb 2015 08:13:38 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id ol5si19594060lbb.46.2015.02.03.08.13.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 08:13:38 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id pv20so53031695lab.7 for ; Tue, 03 Feb 2015 08:13:38 -0800 (PST) X-Received: by 10.152.219.37 with SMTP id pl5mr21274627lac.6.1422980018111; Tue, 03 Feb 2015 08:13:38 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2036698lbj; Tue, 3 Feb 2015 08:13:37 -0800 (PST) X-Received: by 10.224.12.19 with SMTP id v19mr52655088qav.22.1422980016812; Tue, 03 Feb 2015 08:13:36 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 61si29343013qgx.12.2015.02.03.08.13.35 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 08:13:36 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIg6X-0006P6-Ax; Tue, 03 Feb 2015 16:13:33 +0000 Received: from mail-la0-f53.google.com ([209.85.215.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIg6S-0006Ox-3L for lng-odp@lists.linaro.org; Tue, 03 Feb 2015 16:13:28 +0000 Received: by mail-la0-f53.google.com with SMTP id gq15so53171866lab.12 for ; Tue, 03 Feb 2015 08:13:22 -0800 (PST) X-Received: by 10.152.198.200 with SMTP id je8mr25065779lac.93.1422980002142; Tue, 03 Feb 2015 08:13:22 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id ch1sm5122058lbb.40.2015.02.03.08.13.20 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 08:13:21 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 3 Feb 2015 19:12:55 +0300 Message-Id: <1422979975-32548-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCHv2] api: fix odp_version_api_str() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 odp_version_api_str() has to be in API header while odp_version_impl_str() should be in linux-generic. That change fixes: https://bugs.linaro.org/show_bug.cgi?id=1194 Signed-off-by: Maxim Uvarov Reviewed-by: Mike Holmes --- v2: remove version_types.h include/odp/api/version.h | 29 +++++++++++---------- platform/linux-generic/Makefile.am | 3 +-- .../linux-generic/include/odp/plat/version_types.h | 30 ---------------------- platform/linux-generic/include/odp/version.h | 25 ++++++++---------- 4 files changed, 28 insertions(+), 59 deletions(-) delete mode 100644 platform/linux-generic/include/odp/plat/version_types.h diff --git a/include/odp/api/version.h b/include/odp/api/version.h index 0889d9c..bfeb40b 100644 --- a/include/odp/api/version.h +++ b/include/odp/api/version.h @@ -48,24 +48,27 @@ extern "C" { */ #define ODP_VERSION_API_MINOR 0 +/** @internal Version string expand */ +#define ODP_VERSION_STR_EXPAND(x) #x + +/** @internal Version to string */ +#define ODP_VERSION_TO_STR(x) ODP_VERSION_STR_EXPAND(x) + +/** @internal API version string */ +#define ODP_VERSION_API_STR \ +ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \ +ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \ +ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) + /** * Returns ODP API version string */ -const char *odp_version_api_str(void); - +static inline const char *odp_version_api_str(void) +{ + return ODP_VERSION_API_STR; +} /** - * Returns ODP implementation version string - * - * Every implementation of ODP may receive bug fixes independent of the version - * of the API changing, this function returns that indication string. - * @note This string is implementation specific. - * @sa odp_version_api_str() - * - * @return null terminated implementation specific version identifier string - */ -const char *odp_version_impl_str(void); -/** * @} */ diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index addb5ec..3624377 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -56,8 +56,7 @@ odpplatinclude_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/odp/plat/pool_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/queue_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/schedule_types.h \ - $(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h \ - $(top_srcdir)/platform/linux-generic/include/odp/plat/version_types.h + $(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h odpapiincludedir= $(includedir)/odp/api odpapiinclude_HEADERS = \ diff --git a/platform/linux-generic/include/odp/plat/version_types.h b/platform/linux-generic/include/odp/plat/version_types.h deleted file mode 100644 index e3327eb..0000000 --- a/platform/linux-generic/include/odp/plat/version_types.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_VERSION_TYPESH_ -#define ODP_VERSION_TYPESH_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** @internal Version string expand */ -#define ODP_VERSION_STR_EXPAND(x) #x - -/** @internal Version to string */ -#define ODP_VERSION_TO_STR(x) ODP_VERSION_STR_EXPAND(x) - -/** @internal API version string */ -#define ODP_VERSION_API_STR \ -ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \ -ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \ -ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/version.h b/platform/linux-generic/include/odp/version.h index f29320a..33cc5ba 100644 --- a/platform/linux-generic/include/odp/version.h +++ b/platform/linux-generic/include/odp/version.h @@ -17,22 +17,19 @@ extern "C" { #endif -#include - -/** @ingroup odp_ver_abt_log_dbg - * @{ - */ - -static inline const char *odp_version_api_str(void) -{ - return ODP_VERSION_API_STR; -} +#include /** - * @} - */ - -#include + * Returns ODP implementation version string + * + * Every implementation of ODP may receive bug fixes independent of the version + * of the API changing, this function returns that indication string. + * @note This string is implementation specific. + * @sa odp_version_api_str() + * + * @return null terminated implementation specific version identifier string + */ +const char *odp_version_impl_str(void); #ifdef __cplusplus }