From cd9334104cf10f9476ecb26c7e1b8c819d048074 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 25 Mar 2021 12:03:12 -0400 Subject: [PATCH] Add a C++ version of lttng_ust_is_signed_type Change-Id: Iee3da5491bb00fb5144ecf631a122969396d1b40 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-utils.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 /** -- 2.34.1