X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-writer%2Fserialize-internal.h;h=85e2fec348bd96dbdccf139b0279fd42c89d503b;hp=781a3dd7f1938425892cf2fb7325170b165e9f9b;hb=44c440bc5fe8219cc17d1b786d91fd83c4c9860a;hpb=6c711b23bd5bc6eb6b91f6c425080f2d6966f164 diff --git a/include/babeltrace/ctf-writer/serialize-internal.h b/include/babeltrace/ctf-writer/serialize-internal.h index 781a3dd7..85e2fec3 100644 --- a/include/babeltrace/ctf-writer/serialize-internal.h +++ b/include/babeltrace/ctf-writer/serialize-internal.h @@ -33,16 +33,24 @@ #include #include #include -#include -#include -#include #include +#include #include #include #include +#include +#include +#include +#include #define PACKET_LEN_INCREMENT (bt_common_get_page_size() * 8 * CHAR_BIT) +#if (BYTE_ORDER == BIG_ENDIAN) +# define BT_CTF_MY_BYTE_ORDER BT_CTF_BYTE_ORDER_BIG_ENDIAN +#else +# define BT_CTF_MY_BYTE_ORDER BT_CTF_BYTE_ORDER_LITTLE_ENDIAN +#endif + struct bt_ctf_stream_pos { int fd; int prot; /* mmap protection */ @@ -57,12 +65,12 @@ struct bt_ctf_stream_pos { }; BT_HIDDEN -int bt_ctf_field_integer_write(struct bt_ctf_field_integer *field, +int bt_ctf_field_integer_write(struct bt_ctf_field_common *field, struct bt_ctf_stream_pos *pos, enum bt_ctf_byte_order native_byte_order); BT_HIDDEN -int bt_ctf_field_floating_point_write(struct bt_ctf_field_floating_point *field, +int bt_ctf_field_floating_point_write(struct bt_ctf_field_common *field, struct bt_ctf_stream_pos *pos, enum bt_ctf_byte_order native_byte_order); @@ -117,7 +125,7 @@ static inline char *bt_ctf_stream_pos_get_addr(struct bt_ctf_stream_pos *pos) { /* Only makes sense to get the address after aligning on CHAR_BIT */ - assert(!(pos->offset % CHAR_BIT)); + BT_ASSERT(!(pos->offset % CHAR_BIT)); return ((char *) mmap_align_addr(pos->base_mma)) + pos->mmap_base_offset + (pos->offset / CHAR_BIT); }