From d60b551b90300e899c5849558514725effeca342 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Wed, 8 Mar 2023 13:35:22 +0100 Subject: [PATCH] util/format: Make format_table compatible with C++ Signed-off-by: Danylo Piliaiev Reviewed-by: Jesse Natalie Part-of: --- src/util/format/u_format_table.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/util/format/u_format_table.py b/src/util/format/u_format_table.py index 9b7c315..fdab1a2 100644 --- a/src/util/format/u_format_table.py +++ b/src/util/format/u_format_table.py @@ -143,8 +143,17 @@ def write_format_table(formats): write_format_table_header(sys.stdout2) + print('#ifdef __cplusplus', file=sys.stdout2) + print('extern "C" {', file=sys.stdout2) + print('#endif', file=sys.stdout2) + print(file=sys.stdout2) + u_format_pack.generate(formats) + print('#ifdef __cplusplus', file=sys.stdout2) + print('} /* extern "C" */', file=sys.stdout2) + print('#endif', file=sys.stdout2) + def do_channel_array(channels, swizzles): print(" {") for i in range(4): -- 2.7.4