summaryrefslogtreecommitdiffstats
path: root/common/os_calls.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/os_calls.h')
-rw-r--r--common/os_calls.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/os_calls.h b/common/os_calls.h
index 6a7cd093..a843b2e7 100644
--- a/common/os_calls.h
+++ b/common/os_calls.h
@@ -25,6 +25,7 @@
#define NULL 0
#endif
+#include <stdlib.h>
#include "arch.h"
#define g_tcp_can_recv g_sck_can_recv
@@ -183,4 +184,10 @@ int APP_CC g_shmdt(const void *shmaddr);
int APP_CC g_gethostname(char *name, int len);
int APP_CC g_mirror_memcpy(void *dst, const void *src, int len);
+/* glib-style wrappers */
+#define g_new(struct_type, n_structs) \
+ (struct_type *) malloc(sizeof(struct_type) * (n_structs))
+#define g_new0(struct_type, n_structs) \
+ (struct_type *) calloc((n_structs), sizeof(struct_type))
+
#endif