X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Flttng%2Fust-utils.h;h=13d2a7ae1a3049d6815b707320977604678ea2be;hb=11bce05634f2217def46fbbdb492afbf3dd664c2;hp=baca88f271184840512ea97745320d8bef65e333;hpb=d465835d05ead88505e49aa62319b22dfc1fc026;p=lttng-ust.git diff --git a/include/lttng/ust-utils.h b/include/lttng/ust-utils.h index baca88f2..13d2a7ae 100644 --- a/include/lttng/ust-utils.h +++ b/include/lttng/ust-utils.h @@ -28,7 +28,11 @@ * * Returns true if the type of @type is signed. */ -#define lttng_ust_is_signed_type(type) ((type) -1 < (type) 1) +#if defined(__cplusplus) +#define lttng_ust_is_signed_type(type) (std::is_signed::value) +#else +#define lttng_ust_is_signed_type(type) ((type) -1 < (type) 1) +#endif /** @@ -61,9 +65,9 @@ * user are of an integral type. */ #define lttng_ust_ctf_array_element_type_is_supported(type, item) \ - lttng_static_assert(lttng_ust_is_integer_type(type), \ + lttng_ust_static_assert(lttng_ust_is_integer_type(type), \ "Non-integer type `" #item "` not supported as element of CTF_ARRAY or CTF_SEQUENCE", \ - Non_integer_type__##item##__not_supported_as_element_of_CTF_ARRAY_or_CTF_SEQUENCE); + Non_integer_type__##item##__not_supported_as_element_of_CTF_ARRAY_or_CTF_SEQUENCE) /**