diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-11 18:58:45 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-12 19:26:12 -0400 |
commit | 2244a6fbe6012924e74c7f2197512a55e9238b05 (patch) | |
tree | 4ed9c206c3bcffc0fcd4d467f3f4b914b34cac5b /src/shared | |
parent | 2da833ac2d91abc6b4e3fa613b7eebbaba76144a (diff) |
util: add wrapper for realloc to avoid specyfing type
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h index a8e962ea50..99ec0a39bd 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -618,6 +618,8 @@ char *strextend(char **x, ...); char *strrep(const char *s, unsigned n); void* greedy_realloc(void **p, size_t *allocated, size_t need); +#define GREEDY_REALLOC(array, allocated, need) \ + greedy_realloc((void**) &(array), &(allocated), (sizeof *array) * (need)) static inline void _reset_errno_(int *saved_errno) { errno = *saved_errno; |