shmalloc: Make it build in non-glib world
authorOlivier Crête <olivier.crete@collabora.co.uk>
Thu, 28 Jan 2010 13:34:44 +0000 (15:34 +0200)
committerOlivier Crête <olivier.crete@collabora.co.uk>
Thu, 3 Jun 2010 19:27:42 +0000 (15:27 -0400)
gst/shm/shmalloc.h
gst/shm/shmpipe.c
gst/shm/shmpipe.h

index 442b0c4..6a0609d 100644 (file)
@@ -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__ */
index ae4c1e1..8697663 100644 (file)
@@ -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;
       }
 
index 86b1363..f9a4afa 100644 (file)
 #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__ */