From 4db87f973994976025cd10634faad577e6695036 Mon Sep 17 00:00:00 2001 From: Stefan Puiu Date: Fri, 20 Feb 2015 15:23:26 +0200 Subject: [PATCH] lib: fix C++11 compilation In C++11 concatenated string literals need to have a space in between. Found with clang++-3.4, IIRC g++-4.8 also complains about this. Sample error message: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] Signed-off-by: Stefan Puiu Reviewed-by: John McNamara --- lib/librte_eal/common/include/rte_pci.h | 4 ++-- lib/librte_mempool/rte_mempool.h | 8 ++++---- lib/librte_vhost/vhost-net.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 4301c160db..98364463f8 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -93,10 +93,10 @@ extern struct pci_device_list pci_device_list; /**< Global list of PCI devices. #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices" /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */ -#define PCI_PRI_FMT "%.4"PRIx16":%.2"PRIx8":%.2"PRIx8".%"PRIx8 +#define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 /** Short formatting string, without domain, for PCI device: Ex: 00:01.0 */ -#define PCI_SHORT_PRI_FMT "%.2"PRIx8":%.2"PRIx8".%"PRIx8 +#define PCI_SHORT_PRI_FMT "%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 /** Nb. of values in PCI device identifier format string. */ #define PCI_FMT_NVAL 4 diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 331465184b..48e9972264 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -342,7 +342,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, if (cookie != RTE_MEMPOOL_HEADER_COOKIE1) { rte_log_set_history(0); RTE_LOG(CRIT, MEMPOOL, - "obj=%p, mempool=%p, cookie=%"PRIx64"\n", + "obj=%p, mempool=%p, cookie=%" PRIx64 "\n", obj, mp, cookie); rte_panic("MEMPOOL: bad header cookie (put)\n"); } @@ -352,7 +352,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, if (cookie != RTE_MEMPOOL_HEADER_COOKIE2) { rte_log_set_history(0); RTE_LOG(CRIT, MEMPOOL, - "obj=%p, mempool=%p, cookie=%"PRIx64"\n", + "obj=%p, mempool=%p, cookie=%" PRIx64 "\n", obj, mp, cookie); rte_panic("MEMPOOL: bad header cookie (get)\n"); } @@ -363,7 +363,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, cookie != RTE_MEMPOOL_HEADER_COOKIE2) { rte_log_set_history(0); RTE_LOG(CRIT, MEMPOOL, - "obj=%p, mempool=%p, cookie=%"PRIx64"\n", + "obj=%p, mempool=%p, cookie=%" PRIx64 "\n", obj, mp, cookie); rte_panic("MEMPOOL: bad header cookie (audit)\n"); } @@ -372,7 +372,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, if (cookie != RTE_MEMPOOL_TRAILER_COOKIE) { rte_log_set_history(0); RTE_LOG(CRIT, MEMPOOL, - "obj=%p, mempool=%p, cookie=%"PRIx64"\n", + "obj=%p, mempool=%p, cookie=%" PRIx64 "\n", obj, mp, cookie); rte_panic("MEMPOOL: bad trailer cookie\n"); } diff --git a/lib/librte_vhost/vhost-net.h b/lib/librte_vhost/vhost-net.h index 0f3f8dc939..c69b60bfa7 100644 --- a/lib/librte_vhost/vhost-net.h +++ b/lib/librte_vhost/vhost-net.h @@ -59,9 +59,9 @@ extern struct vhost_net_device_ops const *ops; char packet[VHOST_MAX_PRINT_BUFF]; \ \ if ((header)) \ - snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%"PRIu64") Header size %d: ", (device->device_fh), (size)); \ + snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%" PRIu64 ") Header size %d: ", (device->device_fh), (size)); \ else \ - snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%"PRIu64") Packet size %d: ", (device->device_fh), (size)); \ + snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%" PRIu64 ") Packet size %d: ", (device->device_fh), (size)); \ for (index = 0; index < (size); index++) { \ snprintf(packet + strnlen(packet, VHOST_MAX_PRINT_BUFF), VHOST_MAX_PRINT_BUFF - strnlen(packet, VHOST_MAX_PRINT_BUFF), \ "%02hhx ", pkt_addr[index]); \ -- 2.20.1