From: Michael Jeanson Date: Thu, 25 Mar 2021 16:03:12 +0000 (-0400) Subject: Add a C++ version of lttng_ust_is_signed_type X-Git-Tag: v2.13.0-rc1~186 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cd9334104cf10f9476ecb26c7e1b8c819d048074;p=lttng-ust.git Add a C++ version of lttng_ust_is_signed_type Change-Id: Iee3da5491bb00fb5144ecf631a122969396d1b40 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-utils.h b/include/lttng/ust-utils.h index baca88f2..2a65dd53 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 /**