Use __typeof__ instead of typeof
When compiling the ctf plugin as C++, a common error was:
In file included from /home/simark/src/babeltrace/src/plugins/ctf/common/bfcr/bfcr.cpp:23:
/home/simark/src/babeltrace/src/plugins/ctf/common/bfcr/bfcr.cpp: In function ‘void read_unsigned_bitfield(bt_bfcr*, const uint8_t*, size_t, unsigned int, ctf_byte_order, uint64_t*)’:
/home/simark/src/babeltrace/src/compat/bitfield.h:343:9: error: ‘typeof’ was not declared in this scope
343 | typeof(*(vptr)) *_vptr = (vptr); \
| ^~~~~~
Use __typeof__ instead, gcc and clang seem happy with that in both C and
C++. Using `decltype` or `auto` would be more C++-y, but using
__typeof__ works and we don't need separate paths for both languages.
Change-Id: Iec503420f27dd2fe0a246d02af9380a2cff1c96e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7098
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.063362 seconds and 4 git commands to generate.