[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH experiment 08/16] tracetool: add extern "C" around generated head
From: |
Paolo Bonzini |
Subject: |
[PATCH experiment 08/16] tracetool: add extern "C" around generated headers |
Date: |
Mon, 14 Mar 2022 10:31:55 +0100 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/tracetool/format/h.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py
index e94f0be7da..2d92fa8bd2 100644
--- a/scripts/tracetool/format/h.py
+++ b/scripts/tracetool/format/h.py
@@ -27,6 +27,9 @@ def generate(events, backend, group):
'#define TRACE_%s_GENERATED_TRACERS_H' % group.upper(),
'',
'#include "%s"' % header,
+ '#ifdef __cplusplus',
+ 'extern "C" {',
+ '#endif'
'')
for e in events:
@@ -100,4 +103,7 @@ def generate(events, backend, group):
backend.generate_end(events, group)
- out('#endif /* TRACE_%s_GENERATED_TRACERS_H */' % group.upper())
+ out('#ifdef __cplusplus',
+ '}',
+ '#endif',
+ '#endif /* TRACE_%s_GENERATED_TRACERS_H */' % group.upper())
--
2.35.1
- [PATCH experiment 12/16] remove "new" keyword from trace-events, (continued)
- [PATCH experiment 12/16] remove "new" keyword from trace-events, Paolo Bonzini, 2022/03/14
- [PATCH experiment 16/16] port test-coroutine to C++ coroutines, Paolo Bonzini, 2022/03/14
- [PATCH experiment 14/16] util: introduce C++ stackless coroutine backend, Paolo Bonzini, 2022/03/14
- [PATCH experiment 10/16] add space between liter and string macro, Paolo Bonzini, 2022/03/14
- [PATCH experiment 04/16] coroutine: introduce QemuCoLockable, Paolo Bonzini, 2022/03/14
- [PATCH experiment 06/16] use g_new0 instead of g_malloc0, Paolo Bonzini, 2022/03/14
- [PATCH experiment 08/16] tracetool: add extern "C" around generated headers,
Paolo Bonzini <=
- [PATCH experiment 09/16] start adding extern "C" markers, Paolo Bonzini, 2022/03/14
- [PATCH experiment 11/16] bump to C++20, Paolo Bonzini, 2022/03/14
- [PATCH experiment 15/16] port QemuCoLockable to C++ coroutines, Paolo Bonzini, 2022/03/14
- Re: [PATCH experiment 00/16] C++20 coroutine backend, Stefan Hajnoczi, 2022/03/14