summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2010-01-28 15:34:44 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2010-06-03 15:27:42 -0400
commit807da2165a7810b72ef589a8d6c6c0044c7454ef (patch)
tree624afef6b72dd2f38a1bf5a33ab3708de5ca98d4
parentc8eb511a9d184e2d05e32fc9eac73ce5148f6851 (diff)
shmalloc: Make it build in non-glib world
-rw-r--r--gst/shm/shmalloc.h9
-rw-r--r--gst/shm/shmpipe.c3
-rw-r--r--gst/shm/shmpipe.h9
3 files changed, 17 insertions, 4 deletions
diff --git a/gst/shm/shmalloc.h b/gst/shm/shmalloc.h
index 442b0c423..6a0609ddb 100644
--- a/gst/shm/shmalloc.h
+++ b/gst/shm/shmalloc.h
@@ -15,8 +15,8 @@
#else
-#define spalloc_new0(type) malloc (sizeof (type))
-#define spalloc_alloc0(size) malloc (size)
+#define spalloc_new(type) malloc (sizeof (type))
+#define spalloc_alloc(size) malloc (size)
#define spalloc_free(type, buf) free (buf)
#define spalloc_free1(size, buf) free (buf)
@@ -39,4 +39,9 @@ void shm_alloc_space_block_dec (ShmAllocBlock * block);
ShmAllocBlock * shm_alloc_space_block_get (ShmAllocSpace * space,
unsigned long offset);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __SHMALLOC_H__ */
diff --git a/gst/shm/shmpipe.c b/gst/shm/shmpipe.c
index ae4c1e149..869766367 100644
--- a/gst/shm/shmpipe.c
+++ b/gst/shm/shmpipe.c
@@ -466,7 +466,7 @@ sp_writer_free_block (ShmBlock * block)
/* Returns the number of client this has successfully been sent to */
int
-sp_writer_send_buf (ShmPipe * self, gchar * buf, size_t size)
+sp_writer_send_buf (ShmPipe * self, char * buf, size_t size)
{
ShmArea *area = NULL;
unsigned long offset = 0;
@@ -562,7 +562,6 @@ sp_client_recv (ShmPipe * self, char **buf)
cb.payload.new_shm_area.path_size, 0);
if (retval != cb.payload.new_shm_area.path_size) {
free (area_name);
- g_debug ("retval: %d, errno: %d", retval, errno);
return -3;
}
diff --git a/gst/shm/shmpipe.h b/gst/shm/shmpipe.h
index 86b13630f..f9a4afa31 100644
--- a/gst/shm/shmpipe.h
+++ b/gst/shm/shmpipe.h
@@ -37,6 +37,11 @@
#include <sys/stat.h>
#include <fcntl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct _ShmClient ShmClient;
typedef struct _ShmPipe ShmPipe;
typedef struct _ShmBlock ShmBlock;
@@ -65,4 +70,8 @@ ShmPipe *sp_client_open (const char *path);
unsigned long sp_client_recv (ShmPipe * self, char **buf);
int sp_client_recv_finish (ShmPipe * self, char *buf);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __SHMPIPE_H__ */