mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 18:06:56 +00:00
qlit: Change compound literals to initializers
The QLIT_QFOO() macros expand into compound literals. Sadly, gcc doesn't recognizes these as constant expressions (clang does), which makes the macros useless for initializing objects with static storage duration. There is a gcc bug about it: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71713 Change the macros to expand into initializers. Backports commit d5cd8fbf130312bea91823c41de87d55818d599b from qemu
This commit is contained in:
parent
a5d527ca72
commit
b462c3929f
|
@ -36,13 +36,13 @@ struct QLitDictEntry {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define QLIT_QNUM(val) \
|
#define QLIT_QNUM(val) \
|
||||||
(QLitObject){.type = QTYPE_QNUM, .value.qnum = (val)}
|
{ .type = QTYPE_QNUM, .value.qnum = (val) }
|
||||||
#define QLIT_QSTR(val) \
|
#define QLIT_QSTR(val) \
|
||||||
(QLitObject){.type = QTYPE_QSTRING, .value.qstr = (val)}
|
{ .type = QTYPE_QSTRING, .value.qstr = (val) }
|
||||||
#define QLIT_QDICT(val) \
|
#define QLIT_QDICT(val) \
|
||||||
(QLitObject){.type = QTYPE_QDICT, .value.qdict = (val)}
|
{ .type = QTYPE_QDICT, .value.qdict = (val) }
|
||||||
#define QLIT_QLIST(val) \
|
#define QLIT_QLIST(val) \
|
||||||
(QLitObject){.type = QTYPE_QLIST, .value.qlist = (val)}
|
{ .type = QTYPE_QLIST, .value.qlist = (val) }
|
||||||
|
|
||||||
int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs);
|
int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue