DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/1] compat: fixed versioning macros
Date: Tue, 23 Jun 2015 13:38:14 +0200	[thread overview]
Message-ID: <1435059494-6245-1-git-send-email-maciejx.t.gajdzica@intel.com> (raw)

Previous version of versioning macros didn't work properly. When
building dpdk as static library, external application couldn't use
versioned function. It happened, because versioning macros for static
library were empty. Now the same version of versioning macros is used
for both static and dynamic libraries.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
---
 lib/librte_compat/rte_compat.h |   25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
index fb0dc19..c5752c1 100644
--- a/lib/librte_compat/rte_compat.h
+++ b/lib/librte_compat/rte_compat.h
@@ -32,8 +32,6 @@
 #define _RTE_COMPAT_H_
 #include <rte_common.h>
 
-#ifdef RTE_BUILD_SHARED_LIB
-
 /*
  * Provides backwards compatibility when updating exported functions.
  * When a symol is exported from a library to provide an API, it also provides a
@@ -59,12 +57,14 @@
  * 3) Add this macro immediately below the function
  *	VERSION_SYMBOL(foo, _v20, 2.0);
  *
- * 4) Implement a new version of foo.
- *	char foo(int value, int otherval) { ...}
+ * 4) Implement a new version of foo with _v21 suffix.
+ *	char foo_v21(int value, int otherval) { ...}
  *
  * 5) Mark the newest version as the default version
- *	BIND_DEFAULT_SYMBOL(foo, 2.1);
+ *	BIND_DEFAULT_SYMBOL(foo, _v21, 2.1);
  *
+ * 6) Header file should contain definitions of all three
+ * functions (foo, foo_v20, foo_v21).
  */
 
 /*
@@ -96,19 +96,4 @@
 #define BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@@DPDK_"RTE_STR(n))
 #define __vsym __attribute__((used))
 
-#else
-/*
- * No symbol versioning in use
- */
-#define VERSION_SYMBOL(b, e, v)
-#define __vsym
-#define BASE_SYMBOL(b, n)
-#define BIND_DEFAULT_SYMBOL(b, v)
-
-/*
- * RTE_BUILD_SHARED_LIB=n
- */
-#endif
-
-
 #endif /* _RTE_COMPAT_H_ */
-- 
1.7.9.5

             reply	other threads:[~2015-06-23 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 11:38 Maciej Gajdzica [this message]
2015-06-24 17:42 ` [dpdk-dev] [dpdk-dev,1/1] " Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435059494-6245-1-git-send-email-maciejx.t.gajdzica@intel.com \
    --to=maciejx.t.gajdzica@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).