DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andre Muezerie <andremue@linux.microsoft.com>
Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH 2/5] app/test-compress-perf: use portable macro for weak linking
Date: Mon, 23 Dec 2024 19:05:49 -0800	[thread overview]
Message-ID: <1735009552-31906-3-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1735009552-31906-1-git-send-email-andremue@linux.microsoft.com>

MSVC uses pragmas to indicate weak linking, so the old __rte_weak
attribute needs to made into a macro so that the same syntax can
be used for MSVC and other compilers like gcc.

This patch replaces __rte_weak with macro RTE_WEAK.

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
 app/test-compress-perf/main.c | 36 +++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c
index fa366123ed..01742a39ee 100644
--- a/app/test-compress-perf/main.c
+++ b/app/test-compress-perf/main.c
@@ -522,8 +522,8 @@ main(int argc, char **argv)
 	return ret;
 }
 
-__rte_weak void *
-cperf_cyclecount_test_constructor(uint8_t dev_id __rte_unused,
+void *
+RTE_WEAK(cperf_cyclecount_test_constructor)(uint8_t dev_id __rte_unused,
 				 uint16_t qp_id __rte_unused,
 				 struct comp_test_data *options __rte_unused)
 {
@@ -531,20 +531,20 @@ cperf_cyclecount_test_constructor(uint8_t dev_id __rte_unused,
 	return NULL;
 }
 
-__rte_weak void
-cperf_cyclecount_test_destructor(void *arg __rte_unused)
+void
+RTE_WEAK(cperf_cyclecount_test_destructor)(void *arg __rte_unused)
 {
 	RTE_LOG(INFO, USER1, "Something wrong happened!!!\n");
 }
 
-__rte_weak int
-cperf_cyclecount_test_runner(void *test_ctx __rte_unused)
+int
+RTE_WEAK(cperf_cyclecount_test_runner)(void *test_ctx __rte_unused)
 {
 	return 0;
 }
 
-__rte_weak void *
-cperf_throughput_test_constructor(uint8_t dev_id __rte_unused,
+void *
+RTE_WEAK(cperf_throughput_test_constructor)(uint8_t dev_id __rte_unused,
 				 uint16_t qp_id __rte_unused,
 				 struct comp_test_data *options __rte_unused)
 {
@@ -552,19 +552,19 @@ cperf_throughput_test_constructor(uint8_t dev_id __rte_unused,
 	return NULL;
 }
 
-__rte_weak void
-cperf_throughput_test_destructor(void *arg __rte_unused)
+void
+RTE_WEAK(cperf_throughput_test_destructor)(void *arg __rte_unused)
 {
 
 }
 
-__rte_weak int
-cperf_throughput_test_runner(void *test_ctx __rte_unused)
+int
+RTE_WEAK(cperf_throughput_test_runner)(void *test_ctx __rte_unused)
 {
 	return 0;
 }
-__rte_weak void *
-cperf_verify_test_constructor(uint8_t dev_id __rte_unused,
+void *
+RTE_WEAK(cperf_verify_test_constructor)(uint8_t dev_id __rte_unused,
 				 uint16_t qp_id __rte_unused,
 				 struct comp_test_data *options __rte_unused)
 {
@@ -572,14 +572,14 @@ cperf_verify_test_constructor(uint8_t dev_id __rte_unused,
 	return NULL;
 }
 
-__rte_weak void
-cperf_verify_test_destructor(void *arg __rte_unused)
+void
+RTE_WEAK(cperf_verify_test_destructor)(void *arg __rte_unused)
 {
 
 }
 
-__rte_weak int
-cperf_verify_test_runner(void *test_ctx __rte_unused)
+int
+RTE_WEAK(cperf_verify_test_runner)(void *test_ctx __rte_unused)
 {
 	return 0;
 }
-- 
2.47.0.vfs.0.3


  parent reply	other threads:[~2024-12-24  3:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-24  3:05 [PATCH 0/5] " Andre Muezerie
2024-12-24  3:05 ` [PATCH 1/5] lib/eal: add " Andre Muezerie
2024-12-24  3:05 ` Andre Muezerie [this message]
2024-12-24  3:05 ` [PATCH 3/5] drivers/bus: use " Andre Muezerie
2024-12-24  3:05 ` [PATCH 4/5] drivers/common: " Andre Muezerie
2024-12-24  3:05 ` [PATCH 5/5] drivers/net: " Andre Muezerie

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=1735009552-31906-3-git-send-email-andremue@linux.microsoft.com \
    --to=andremue@linux.microsoft.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).