Common Trace Format 2 generation
[lttng-tools.git] / src / common / tracker.cpp
index 84b6c6b8f11c33f31039f711ddb0061f5d6ae568..38ffb695bbdae85c1bd38a179400629ad9d75064 100644 (file)
 #include <lttng/lttng-error.h>
 #include <lttng/tracker.h>
 
-#include <common/dynamic-array.h>
-#include <common/error.h>
-#include <common/hashtable/hashtable.h>
-#include <common/hashtable/utils.h>
-#include <common/tracker.h>
+#include <common/dynamic-array.hpp>
+#include <common/error.hpp>
+#include <common/hashtable/hashtable.hpp>
+#include <common/hashtable/utils.hpp>
+#include <common/tracker.hpp>
 
 #include <stdbool.h>
+#include <type_traits>
 
 struct process_attr_tracker_values_comm_header {
        uint32_t count;
@@ -33,16 +34,16 @@ struct process_attr_tracker_value_comm {
 };
 
 #define GET_INTEGRAL_COMM_VALUE(value_ptr, as_type)              \
-       ((as_type)(is_signed(as_type) ? (value_ptr)->u._signed : \
-                                       (value_ptr)->u._unsigned))
+       ((as_type)(std::is_signed<as_type>::value ?              \
+                       (value_ptr)->u._signed : (value_ptr)->u._unsigned))
 
-#define SET_INTEGRAL_COMM_VALUE(comm_value, value)                         \
-       if (is_signed(typeof(value))) {                                    \
+#define SET_INTEGRAL_COMM_VALUE(comm_value, from_value)                         \
+       if (std::is_signed<decltype(from_value)>::value) {                      \
                (comm_value)->u._signed =                                  \
-                               (typeof((comm_value)->u._signed)) value;   \
+                               (typeof((comm_value)->u._signed)) from_value;   \
        } else {                                                           \
                (comm_value)->u._unsigned =                                \
-                               (typeof((comm_value)->u._unsigned)) value; \
+                               (typeof((comm_value)->u._unsigned)) from_value; \
        }
 
 static inline bool is_virtual_process_attr(enum lttng_process_attr process_attr)
This page took 0.025248 seconds and 5 git commands to generate.