mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
freedreno/registers: C++ struct casting
Using C style `(struct foo){ ..args..}` at least confuses eclipse, so
for C++ code use `{ ..args.. }` instead.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22646>
This commit is contained in:
parent
827363f886
commit
09f19672a0
1 changed files with 8 additions and 2 deletions
|
|
@ -221,10 +221,10 @@ class Bitset(object):
|
|||
skip = ""
|
||||
|
||||
if reg.array:
|
||||
print("#define %s(__i, ...) pack_%s(__i, (struct %s) { __VA_ARGS__ })%s\n" %
|
||||
print("#define %s(__i, ...) pack_%s(__i, __struct_cast(%s) { __VA_ARGS__ })%s\n" %
|
||||
(prefix, prefix, prefix, skip))
|
||||
else:
|
||||
print("#define %s(...) pack_%s((struct %s) { __VA_ARGS__ })%s\n" %
|
||||
print("#define %s(...) pack_%s(__struct_cast(%s) { __VA_ARGS__ })%s\n" %
|
||||
(prefix, prefix, prefix, skip))
|
||||
|
||||
|
||||
|
|
@ -649,6 +649,12 @@ def main():
|
|||
print("#include <assert.h>")
|
||||
print()
|
||||
|
||||
print("#ifdef __cplusplus");
|
||||
print("#define __struct_cast(X)")
|
||||
print("#else")
|
||||
print("#define __struct_cast(X) (struct X)")
|
||||
print("#endif")
|
||||
|
||||
try:
|
||||
p.parse(rnn_path, xml_file)
|
||||
except Error as e:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue