From 807da2165a7810b72ef589a8d6c6c0044c7454ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 28 Jan 2010 15:34:44 +0200 Subject: [PATCH] shmalloc: Make it build in non-glib world --- gst/shm/shmalloc.h | 9 +++++++-- gst/shm/shmpipe.c | 3 +-- gst/shm/shmpipe.h | 9 +++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gst/shm/shmalloc.h b/gst/shm/shmalloc.h index 442b0c4..6a0609d 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 ae4c1e1..86976636 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 86b1363..f9a4afa 100644 --- a/gst/shm/shmpipe.h +++ b/gst/shm/shmpipe.h @@ -37,6 +37,11 @@ #include #include + +#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__ */ -- 2.7.4