Fix: headers: make static inline upcasts compatible with C++
[babeltrace.git] / include / babeltrace / graph / self-component-port.h
index ad5daeb8cf52917a4486b92555e8b94b2622ba06..c524cac30eaa5f1a6f10086c99e51385f11d79c8 100644 (file)
@@ -24,7 +24,8 @@
  */
 
 /*
- * For bt_port, bt_self_component_port, bt_self_component, bt_connection
+ * For bt_port, bt_self_component_port, bt_self_component,
+ * bt_connection, __BT_UPCAST_CONST
  */
 #include <babeltrace/types.h>
 
@@ -40,7 +41,7 @@ static inline
 const bt_port *bt_self_component_port_as_port(
                bt_self_component_port *self_port)
 {
-       return (const void *) self_port;
+       return __BT_UPCAST_CONST(bt_port, self_port);
 }
 
 extern bt_self_component *bt_self_component_port_borrow_component(
This page took 0.024015 seconds and 4 git commands to generate.