From 24fd848950b44de7e2d71fb69ba52b90d6acb220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Fri, 16 May 2014 12:51:56 +0200 Subject: qapi: skip redundant includes The purpose of this change is to help create a json file containing common definitions; each bit of generated C code must be emitted only one time. A second history global to all QAPISchema instances has been added to detect when a file is included more than one time and skip these includes. It does not act as a stack and the changes made to it by the __init__ function are propagated back to the caller so it's really a global state. Signed-off-by: Benoit Canet Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- tests/qapi-schema/include-repetition.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/qapi-schema/include-repetition.json (limited to 'tests/qapi-schema/include-repetition.json') diff --git a/tests/qapi-schema/include-repetition.json b/tests/qapi-schema/include-repetition.json new file mode 100644 index 0000000..ec329dd --- /dev/null +++ b/tests/qapi-schema/include-repetition.json @@ -0,0 +1,3 @@ +{ 'include': 'comments.json' } +{ 'include': 'include-repetition-sub.json' } +{ 'include': 'comments.json' } -- cgit v1.1