add C++ macros to xmalloc.h

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@921 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-05-17 20:43:49 +00:00
parent dc9151d355
commit ee4d6b064f

View file

@ -26,11 +26,14 @@
#include <stdlib.h>
#include <limits.h>
#include <assert.h>
#include <polyp/cdecl.h>
/** \file
* Memory allocation functions.
*/
PA_C_DECL_BEGIN
/** Allocate the specified number of bytes, just like malloc() does. However, in case of OOM, terminate */
void* pa_xmalloc(size_t l);
@ -70,4 +73,6 @@ static inline void* pa_xnew0_internal(unsigned n, size_t k) {
/** Same as pa_xnew() but set the memory to zero */
#define pa_xnew0(type, n) ((type*) pa_xnew0_internal((n), sizeof(type)))
PA_C_DECL_END
#endif