unicorn/qemu/include
Max Reitz dbdba16732
qapi: Add qobject_to()
This is a dynamic casting macro that, given a QObject type, returns an
object as that type or NULL if the object is of a different type (or
NULL itself).

The macro uses lower-case letters because:
1. There does not seem to be a hard rule on whether qemu macros have to
be upper-cased,
2. The current situation in qapi/qmp is inconsistent (compare e.g.
QINCREF() vs. qdict_put()),
3. qobject_to() will evaluate its @obj parameter only once, thus it is
generally not important to the caller whether it is a macro or not,
4. I prefer it aesthetically.

The macro parameter order is chosen with typename first for
consistency with other QAPI macros like QAPI_CLONE(), as well as
for legibility (read it as "qobject to" type "applied to" obj).

Backports commit 1a56b1e2ab5e9d6d89386ca953b4afb419e15abe from qemu
2018-03-20 10:45:59 -04:00
..
crypto Drop unused crypto source files 2018-02-17 15:23:57 -05:00
exec target-*: Don't redefine cpu_exec() 2018-03-20 07:02:47 -04:00
fpu configure: Drop ancient Solaris 9 and earlier support 2018-03-09 12:14:21 -05:00
hw machine: use class base init generated name 2018-03-11 16:54:40 -04:00
qapi qapi: Add qobject_to() 2018-03-20 10:45:59 -04:00
qemu compiler: Add QEMU_BUILD_BUG_MSG() macro 2018-03-20 10:43:37 -04:00
qom numa: move numa_node from CPUState into target specific classes 2018-03-20 06:46:20 -04:00
sysemu tcg: add options for enabling MTTCG 2018-03-02 09:25:01 -05:00
config.h import 2015-08-21 15:04:50 +08:00
elf.h include/elf: Update elf.h to commit f71a8eaffba3271cf7cdad95572f6996f7523a5b 2018-03-11 15:34:35 -04:00
glib_compat.h memory: Share FlatView's and dispatch trees between address spaces 2018-03-11 22:05:44 -04:00
qemu-common.h tcg: Add EXCP_ATOMIC 2018-02-27 11:57:58 -05:00