Add a C++ version of lttng_ust_is_signed_type
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 25 Mar 2021 16:03:12 +0000 (12:03 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 29 Mar 2021 18:01:38 +0000 (14:01 -0400)
Change-Id: Iee3da5491bb00fb5144ecf631a122969396d1b40
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-utils.h

index baca88f271184840512ea97745320d8bef65e333..2a65dd5364ef21e996ea7c05d17dff9a09887e8f 100644 (file)
  *
  * 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<type>::value)
+#else
+#define lttng_ust_is_signed_type(type) ((type) -1 < (type) 1)
+#endif
 
 
 /**
This page took 0.02516 seconds and 4 git commands to generate.