X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Ftypes.h;fp=include%2Fbabeltrace%2Ftypes.h;h=12b35f602445698b99e544c7919dbe3b3e8fda9f;hp=9f71793a1b4b095f73f60bf2132e6a2083daec90;hb=005f1204d7620018bb2c1406b6194940f0ee119f;hpb=25f741168b45db9dd975136cfd3f66dbd9af39d0 diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index 9f71793a..12b35f60 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -25,6 +25,15 @@ #include +/* Internal use */ +#ifdef __cplusplus +# define __BT_UPCAST(_type, _p) static_cast<_type *>(static_cast(_p)) +# define __BT_UPCAST_CONST(_type, _p) static_cast(static_cast(_p)) +#else +# define __BT_UPCAST(_type, _p) ((_type *) (_p)) +# define __BT_UPCAST_CONST(_type, _p) ((const _type *) (_p)) +#endif + #ifdef __cplusplus extern "C" { #endif