mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 22:11:11 +00:00
qapi-event: Eliminate global variable event_enum_value
Backports commit 7b24626cd019ed5084c8e3370999176a1ebd44be from qemu
This commit is contained in:
parent
782a549898
commit
533bf08ff1
|
@ -137,7 +137,7 @@ def generate_event_implement(api_name, event_name, params):
|
|||
emit(%(event_enum_value)s, qmp, &local_err);
|
||||
|
||||
""",
|
||||
event_enum_value = event_enum_value)
|
||||
event_enum_value = c_enum_const(event_enum_name, event_name))
|
||||
|
||||
# step 5: clean up
|
||||
if params:
|
||||
|
@ -222,7 +222,6 @@ for expr in exprs:
|
|||
fdecl.write(ret)
|
||||
|
||||
# We need an enum value per event
|
||||
event_enum_value = c_enum_const(event_enum_name, event_name)
|
||||
ret = generate_event_implement(api_name, event_name, params)
|
||||
fdef.write(ret)
|
||||
|
||||
|
|
|
@ -1506,6 +1506,9 @@ const char *const %(name)s_lookup[] = {
|
|||
''',
|
||||
index = index, value = value)
|
||||
|
||||
# Unicorn: We don't use C99 [ARRAY_INDICING] = Thing because
|
||||
# MSVC is still in the stone-age with this part of C compiler
|
||||
# support.
|
||||
max_index = c_enum_const(name, 'MAX', prefix)
|
||||
ret += mcgen('''
|
||||
NULL,
|
||||
|
|
Loading…
Reference in a new issue