diff mbox series

[PULLv4,32/32] slirp: API is extern C

Message ID 20190207140316.16103-33-samuel.thibault@ens-lyon.org (mailing list archive)
State New, archived
Headers show
Series [PULLv4,01/32] slirp: Avoid unaligned 16bit memory access | expand

Commit Message

Samuel Thibault Feb. 7, 2019, 2:03 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Make it possible to use headers easily with C++ projects.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 slirp/libslirp.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/slirp/libslirp.h b/slirp/libslirp.h
index 9b13d8250c..fccab42518 100644
--- a/slirp/libslirp.h
+++ b/slirp/libslirp.h
@@ -12,6 +12,10 @@ 
 #include <arpa/inet.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct Slirp Slirp;
 
 enum {
@@ -96,5 +100,8 @@  void slirp_socket_recv(Slirp *slirp, struct in_addr guest_addr,
                        int guest_port, const uint8_t *buf, int size);
 size_t slirp_socket_can_recv(Slirp *slirp, struct in_addr guest_addr,
                              int guest_port);
-
+#ifdef __cplusplus
+} /* extern "C" */
 #endif
+
+#endif /* LIBSLIRP_H */