qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH experiment 08/16] tracetool: add extern "C" around generated


From: Paolo Bonzini
Subject: Re: [PATCH experiment 08/16] tracetool: add extern "C" around generated headers
Date: Mon, 14 Mar 2022 14:44:04 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 3/14/22 14:33, Philippe Mathieu-Daudé wrote:
On 14/3/22 10:31, Paolo Bonzini wrote:
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'

Why not use G_BEGIN_DECLS?

I wasn't sure if tracetool dependend on glib. It's more a philosophical question than an actual difference, of course.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]