lib: work around unnamed structs/unions
[dpdk.git] / lib / librte_eal / common / include / arch / ppc_64 / rte_cycles.h
index fd26e8e..8fa6fc6 100644 (file)
@@ -39,6 +39,9 @@ extern "C" {
 
 #include "generic/rte_cycles.h"
 
+#include <rte_byteorder.h>
+#include <rte_common.h>
+
 /**
  * Read the time base register.
  *
@@ -50,9 +53,15 @@ rte_rdtsc(void)
 {
        union {
                uint64_t tsc_64;
+               RTE_STD_C11
                struct {
+#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
                        uint32_t hi_32;
                        uint32_t lo_32;
+#else
+                       uint32_t lo_32;
+                       uint32_t hi_32;
+#endif
                };
        } tsc;
        uint32_t tmp;