DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal/ppc: undefine AltiVec keyword vector
@ 2022-05-25  9:53 Thomas Monjalon
  2022-05-25 10:01 ` Tyler Retzlaff
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Thomas Monjalon @ 2022-05-25  9:53 UTC (permalink / raw)
  To: dev; +Cc: mdr, david.marchand, techboard, David Christensen

The AltiVec header file is defining "vector", except in C++ build.
The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector",
so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using
the keyword "vector" for its AltiVec meaning.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index e49cacecef..ee60b17821 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -133,6 +133,11 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* The DPDK header file ``rte_altivec.h``,
+  which is a wrapper for the PPC header file ``altivec.h``,
+  undefines the AltiVec keyword ``vector``.
+  The alternative keyword ``__vector`` should be used instead.
+
 
 ABI Changes
 -----------
diff --git a/lib/eal/ppc/include/rte_altivec.h b/lib/eal/ppc/include/rte_altivec.h
index 1551a94544..7c088d2d16 100644
--- a/lib/eal/ppc/include/rte_altivec.h
+++ b/lib/eal/ppc/include/rte_altivec.h
@@ -9,6 +9,13 @@
 /* To include altivec.h, GCC version must be >= 4.8 */
 #include <altivec.h>
 
+/*
+ * The keyword "vector" is defined in altivec.h,
+ * and often conflicts with code in applications or dependencies.
+ * It is preferred to use the alternative keyword "__vector".
+ */
+#undef vector
+
 /*
  * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11.
  * Otherwise there would be a type conflict between stdbool and altivec.
-- 
2.36.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-06-01 15:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25  9:53 [PATCH] eal/ppc: undefine AltiVec keyword vector Thomas Monjalon
2022-05-25 10:01 ` Tyler Retzlaff
2022-05-25 11:08 ` Ali Alnubani
2022-05-25 11:10   ` Ali Alnubani
2022-05-25 11:48 ` Ray Kinsella
2022-05-25 15:40   ` Thomas Monjalon
2022-05-25 18:02     ` Ray Kinsella
2022-05-25 18:34       ` Tyler Retzlaff
2022-05-26 10:18         ` Thomas Monjalon
2022-05-26 11:02           ` Ray Kinsella
2022-06-01 15:04             ` Thomas Monjalon

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).