X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=inline;f=drivers%2Fnet%2Fmlx4%2Fmlx4_utils.h;h=5718b9c742fa2ae9c20b3941c06fae30ad8fec1c;hb=b02f1573cd0774940f063dade7d5d8606af1d948;hp=a49190252fe1a169fb44a0490cd5a6f9e13b763e;hpb=11a34bf2c0f576044d362e0f550c2b4977ee9c85;p=dpdk.git diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h index a49190252f..5718b9c742 100644 --- a/drivers/net/mlx4/mlx4_utils.h +++ b/drivers/net/mlx4/mlx4_utils.h @@ -15,6 +15,16 @@ #include "mlx4.h" +/* + * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11. + * Otherwise there would be a type conflict between stdbool and altivec. + */ +#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) +#undef bool +/* redefine as in stdbool.h */ +#define bool _Bool +#endif + extern int mlx4_logtype; #ifndef NDEBUG @@ -69,9 +79,10 @@ pmd_drv_log_basename(const char *s) /** Allocate a buffer on the stack and fill it with a printf format string. */ #define MKSTR(name, ...) \ - char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \ + int mkstr_size_##name = snprintf(NULL, 0, "" __VA_ARGS__); \ + char name[mkstr_size_##name + 1]; \ \ - snprintf(name, sizeof(name), __VA_ARGS__) + snprintf(name, sizeof(name), "" __VA_ARGS__) /** Generate a string out of the provided arguments. */ #define MLX4_STR(...) # __VA_ARGS__