summaryrefslogtreecommitdiffstats
path: root/common/mem.h
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-04-19 22:58:36 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:51 +0100
commitc15c5050afa972a8918427e213a2500b44328b85 (patch)
tree9502f025eb55001f35c10576712e4f3f28f9ebe7 /common/mem.h
parent5b0b6d2f8431f55394b0766f0cbe5c26f89fd6cd (diff)
downloadspice-common-c15c5050afa972a8918427e213a2500b44328b85.tar.gz
spice-common-c15c5050afa972a8918427e213a2500b44328b85.tar.xz
spice-common-c15c5050afa972a8918427e213a2500b44328b85.zip
common: add extern "C" guards to headers
Since some spice C++ code is using code from common/, the C functions need to be marked as such for the C++ compiler, otherwise we'll get linkage issues.
Diffstat (limited to 'common/mem.h')
-rw-r--r--common/mem.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/mem.h b/common/mem.h
index 797bba0..8ba6586 100644
--- a/common/mem.h
+++ b/common/mem.h
@@ -22,6 +22,10 @@
#include <stdlib.h>
#include <spice/macros.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct SpiceChunk {
uint8_t *data;
uint32_t len;
@@ -120,4 +124,7 @@ void spice_buffer_append(SpiceBuffer *buffer, const void *data, size_t len);
size_t spice_buffer_copy(SpiceBuffer *buffer, void *dest, size_t len);
size_t spice_buffer_remove(SpiceBuffer *buffer, size_t len);
+#ifdef __cplusplus
+}
+#endif
#endif