net/ipsumdump: better bswap_32 fix

Just include byteswap.h, which defines bswap_32().
This commit is contained in:
Piotr Kubaj 2025-01-17 22:20:47 +01:00
parent d359dba4aa
commit 26a36671be
2 changed files with 10 additions and 12 deletions

View File

@ -1,14 +1,13 @@
--- src/aggtree.cc.orig 2014-05-02 12:23:53 UTC
+++ src/aggtree.cc
@@ -11,9 +11,11 @@
@@ -11,9 +11,7 @@
#ifdef HAVE_BYTEORDER_H
#include <byteorder.h>
#else
+#if !defined(__powerpc__) && !defined(POWERPC64)
static inline uint32_t bswap_32(uint32_t u) {
return ((u >> 24) | ((u & 0xff0000) >> 8) | ((u & 0xff00) << 8) | ((u & 0xff) << 24));
}
+#endif
-static inline uint32_t bswap_32(uint32_t u) {
- return ((u >> 24) | ((u & 0xff0000) >> 8) | ((u & 0xff00) << 8) | ((u & 0xff) << 24));
-}
+#include <byteswap.h>
#endif

View File

@ -1,14 +1,13 @@
--- src/aggwtree.cc.orig 2014-05-02 12:23:53 UTC
+++ src/aggwtree.cc
@@ -10,9 +10,11 @@
@@ -10,9 +10,7 @@
#ifdef HAVE_BYTEORDER_H
#include <byteorder.h>
#else
+#if !defined(__powerpc__) && !defined(POWERPC64)
static inline uint32_t bswap_32(uint32_t u) {
return ((u >> 24) | ((u & 0xff0000) >> 8) | ((u & 0xff00) << 8) | ((u & 0xff) << 24));
}
+#endif
-static inline uint32_t bswap_32(uint32_t u) {
- return ((u >> 24) | ((u & 0xff0000) >> 8) | ((u & 0xff00) << 8) | ((u & 0xff) << 24));
-}
+#include <byteswap.h>
#endif
typedef AggregateWTree::WNode WNode;