From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, hreitz@redhat.com, berrange@redhat.com,
qemu-block@nongnu.org, stefanha@redhat.com
Subject: [PATCH experiment 09/16] start adding extern "C" markers
Date: Mon, 14 Mar 2022 10:31:56 +0100 [thread overview]
Message-ID: <20220314093203.1420404-10-pbonzini@redhat.com> (raw)
In-Reply-To: <20220314093203.1420404-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/block/aio.h | 5 +++++
include/fpu/softfloat-types.h | 4 ++++
include/qemu/bitops.h | 3 +++
include/qemu/bswap.h | 10 +++-------
include/qemu/coroutine.h | 4 ++++
include/qemu/host-utils.h | 4 ++++
include/qemu/notify.h | 4 ++++
include/qemu/qsp.h | 4 ++++
include/qemu/thread.h | 4 ++++
include/qemu/timer.h | 4 ++++
10 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/include/block/aio.h b/include/block/aio.h
index 5634173b12..4b21d95f0b 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -17,12 +17,15 @@
#ifdef CONFIG_LINUX_IO_URING
#include <liburing.h>
#endif
+
#include "qemu/coroutine.h"
#include "qemu/queue.h"
#include "qemu/event_notifier.h"
#include "qemu/thread.h"
#include "qemu/timer.h"
+G_BEGIN_DECLS
+
typedef struct BlockAIOCB BlockAIOCB;
typedef void BlockCompletionFunc(void *opaque, int ret);
@@ -769,4 +772,6 @@ void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
void aio_context_set_aio_params(AioContext *ctx, int64_t max_batch,
Error **errp);
+G_END_DECLS
+
#endif
diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h
index 8abd9ab4ec..aaf7b0b5fa 100644
--- a/include/fpu/softfloat-types.h
+++ b/include/fpu/softfloat-types.h
@@ -80,6 +80,8 @@ this code that are retained.
#ifndef SOFTFLOAT_TYPES_H
#define SOFTFLOAT_TYPES_H
+G_BEGIN_DECLS
+
/*
* Software IEC/IEEE floating-point types.
*/
@@ -197,4 +199,6 @@ typedef struct float_status {
bool no_signaling_nans;
} float_status;
+G_END_DECLS
+
#endif /* SOFTFLOAT_TYPES_H */
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
index 03213ce952..677884bead 100644
--- a/include/qemu/bitops.h
+++ b/include/qemu/bitops.h
@@ -12,6 +12,7 @@
#ifndef BITOPS_H
#define BITOPS_H
+G_BEGIN_DECLS
#include "host-utils.h"
#include "atomic.h"
@@ -618,4 +619,6 @@ static inline uint64_t half_unshuffle64(uint64_t x)
return x;
}
+G_END_DECLS
+
#endif
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 2d3bb8bbed..439e755ed4 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -15,12 +15,10 @@
#define BSWAP_FROM_FALLBACKS
#endif /* ! CONFIG_MACHINE_BSWAP_H */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "fpu/softfloat-types.h"
+G_BEGIN_DECLS
+
#ifdef BSWAP_FROM_BYTESWAP
static inline uint16_t bswap16(uint16_t x)
{
@@ -508,8 +506,6 @@ DO_STN_LDN_P(be)
#undef le_bswaps
#undef be_bswaps
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
#endif /* BSWAP_H */
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index 6f4596fc5b..428e97d946 100644
--- a/include/qemu/coroutine.h
+++ b/include/qemu/coroutine.h
@@ -18,6 +18,8 @@
#include "qemu/queue.h"
#include "qemu/timer.h"
+G_BEGIN_DECLS
+
/**
* Coroutines are a mechanism for stack switching and can be used for
* cooperative userspace threading. These functions provide a simple but
@@ -341,6 +343,8 @@ void qemu_coroutine_increase_pool_batch_size(unsigned int additional_pool_size);
*/
void qemu_coroutine_decrease_pool_batch_size(unsigned int additional_pool_size);
+G_END_DECLS
+
#include "qemu/lockable.h"
#include "qemu/co-lockable.h"
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index ca979dc6cc..406e593dff 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -30,6 +30,8 @@
#ifndef HOST_UTILS_H
#define HOST_UTILS_H
+G_BEGIN_DECLS
+
#include "qemu/compiler.h"
#include "qemu/bswap.h"
@@ -849,4 +851,6 @@ static inline uint64_t udiv_qrnnd(uint64_t *r, uint64_t n1,
#endif
}
+G_END_DECLS
+
#endif
diff --git a/include/qemu/notify.h b/include/qemu/notify.h
index bcfa70fb2e..a8effa39b7 100644
--- a/include/qemu/notify.h
+++ b/include/qemu/notify.h
@@ -14,6 +14,8 @@
#ifndef QEMU_NOTIFY_H
#define QEMU_NOTIFY_H
+G_BEGIN_DECLS
+
#include "qemu/queue.h"
typedef struct Notifier Notifier;
@@ -71,4 +73,6 @@ void notifier_with_return_remove(NotifierWithReturn *notifier);
int notifier_with_return_list_notify(NotifierWithReturnList *list,
void *data);
+G_END_DECLS
+
#endif
diff --git a/include/qemu/qsp.h b/include/qemu/qsp.h
index bf36aabfa8..65389837a1 100644
--- a/include/qemu/qsp.h
+++ b/include/qemu/qsp.h
@@ -16,6 +16,8 @@ enum QSPSortBy {
QSP_SORT_BY_AVG_WAIT_TIME,
};
+G_BEGIN_DECLS
+
void qsp_report(size_t max, enum QSPSortBy sort_by,
bool callsite_coalesce);
@@ -24,4 +26,6 @@ void qsp_enable(void);
void qsp_disable(void);
void qsp_reset(void);
+G_END_DECLS
+
#endif /* QEMU_QSP_H */
diff --git a/include/qemu/thread.h b/include/qemu/thread.h
index 460568d67d..ec27b7ec58 100644
--- a/include/qemu/thread.h
+++ b/include/qemu/thread.h
@@ -22,6 +22,8 @@ typedef struct QemuThread QemuThread;
#define QEMU_THREAD_JOINABLE 0
#define QEMU_THREAD_DETACHED 1
+G_BEGIN_DECLS
+
void qemu_mutex_init(QemuMutex *mutex);
void qemu_mutex_destroy(QemuMutex *mutex);
int qemu_mutex_trylock_impl(QemuMutex *mutex, const char *file, const int line);
@@ -397,4 +399,6 @@ void qemu_lockcnt_inc_and_unlock(QemuLockCnt *lockcnt);
*/
unsigned qemu_lockcnt_count(QemuLockCnt *lockcnt);
+G_END_DECLS
+
#endif
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index ee071e07d1..236c45f1c6 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -5,6 +5,8 @@
#include "qemu/notify.h"
#include "qemu/host-utils.h"
+G_BEGIN_DECLS
+
#define NANOSECONDS_PER_SECOND 1000000000LL
/* timers */
@@ -998,4 +1000,6 @@ static inline int64_t profile_getclock(void)
extern int64_t dev_time;
#endif
+G_END_DECLS
+
#endif
--
2.35.1
next prev parent reply other threads:[~2022-03-14 9:47 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-14 9:31 [PATCH experiment 00/16] C++20 coroutine backend Paolo Bonzini
2022-03-14 9:31 ` [PATCH experiment 01/16] coroutine: add missing coroutine_fn annotations for CoRwlock functions Paolo Bonzini
2022-03-14 9:31 ` [PATCH experiment 02/16] coroutine: qemu_coroutine_get_aio_context is not a coroutine_fn Paolo Bonzini
2022-03-14 9:31 ` [PATCH experiment 03/16] coroutine: small code cleanup in qemu_co_rwlock_wrlock Paolo Bonzini
2022-03-14 13:32 ` Philippe Mathieu-Daudé
2022-03-14 9:31 ` [PATCH experiment 04/16] coroutine: introduce QemuCoLockable Paolo Bonzini
2022-03-14 9:31 ` [PATCH experiment 05/16] port atomic.h to C++ Paolo Bonzini
2022-03-14 9:31 ` [PATCH experiment 06/16] use g_new0 instead of g_malloc0 Paolo Bonzini
2022-03-14 11:16 ` Markus Armbruster
2022-03-14 9:31 ` [PATCH experiment 07/16] start porting compiler.h to C++ Paolo Bonzini
2022-03-14 9:31 ` [PATCH experiment 08/16] tracetool: add extern "C" around generated headers Paolo Bonzini
2022-03-14 13:33 ` Philippe Mathieu-Daudé
2022-03-14 13:44 ` Paolo Bonzini
2022-03-14 9:31 ` Paolo Bonzini [this message]
2022-03-14 9:31 ` [PATCH experiment 10/16] add space between liter and string macro Paolo Bonzini
2022-03-14 9:31 ` [PATCH experiment 11/16] bump to C++20 Paolo Bonzini
2022-03-14 9:31 ` [PATCH experiment 12/16] remove "new" keyword from trace-events Paolo Bonzini
2022-03-14 13:30 ` Philippe Mathieu-Daudé
2022-03-14 9:32 ` [PATCH experiment 13/16] disable some code Paolo Bonzini
2022-03-14 9:32 ` [PATCH experiment 14/16] util: introduce C++ stackless coroutine backend Paolo Bonzini
2022-03-14 14:37 ` Stefan Hajnoczi
2022-03-14 19:36 ` Paolo Bonzini
2022-03-14 9:32 ` [PATCH experiment 15/16] port QemuCoLockable to C++ coroutines Paolo Bonzini
2022-03-14 9:32 ` [PATCH experiment 16/16] port test-coroutine " Paolo Bonzini
2022-03-14 14:07 ` [PATCH experiment 00/16] C++20 coroutine backend Stefan Hajnoczi
2022-03-14 16:21 ` Paolo Bonzini
2022-03-14 19:51 ` Richard Henderson
2022-03-15 14:05 ` Stefan Hajnoczi
2022-03-15 14:24 ` Peter Maydell
2022-03-15 17:29 ` Paolo Bonzini
2022-03-16 12:32 ` Stefan Hajnoczi
2022-03-16 13:06 ` Daniel P. Berrangé
2022-03-16 16:44 ` Stefan Hajnoczi
2022-03-17 15:11 ` Paolo Bonzini
2022-03-17 15:53 ` Hanna Reitz
2022-03-31 11:37 ` Markus Armbruster
2022-03-15 14:50 ` Kevin Wolf
2022-03-15 15:35 ` Stefan Hajnoczi
2022-03-15 15:55 ` Daniel P. Berrangé
2022-03-15 23:08 ` Paolo Bonzini
2022-03-16 12:40 ` Stefan Hajnoczi
2022-03-16 16:15 ` Kevin Wolf
2022-03-17 12:16 ` Dr. David Alan Gilbert
2022-03-17 12:51 ` Daniel P. Berrangé
2022-03-31 11:52 ` Markus Armbruster
2022-03-15 17:23 ` When and how to use C++ (was Re: [PATCH experiment 00/16] C++20 coroutine backend) Paolo Bonzini
2022-03-14 16:52 ` [PATCH experiment 00/16] C++20 coroutine backend Daniel P. Berrangé
2022-03-15 9:05 ` Paolo Bonzini
2022-03-15 9:32 ` Daniel P. Berrangé
2022-03-15 17:27 ` Paolo Bonzini
2022-03-15 18:12 ` Daniel P. Berrangé
2022-03-15 16:15 ` Daniel P. Berrangé
2022-03-15 17:50 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220314093203.1420404-10-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).