diff options
author | Mattias Andrée <maandree@kth.se> | 2018-09-02 15:32:56 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-09-02 15:32:56 +0200 |
commit | 47128b7def4954c4cf544924c94f018d88033374 (patch) | |
tree | c75e6c76c078a095ff691d42a1f0b2d0ea0f0357 /envmemalloc.c | |
parent | Add malloc function attribute were appropriate (diff) | |
download | libsimple-47128b7def4954c4cf544924c94f018d88033374.tar.gz libsimple-47128b7def4954c4cf544924c94f018d88033374.tar.bz2 libsimple-47128b7def4954c4cf544924c94f018d88033374.tar.xz |
misc
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'envmemalloc.c')
-rw-r--r-- | envmemalloc.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/envmemalloc.c b/envmemalloc.c new file mode 100644 index 0000000..c500063 --- /dev/null +++ b/envmemalloc.c @@ -0,0 +1,29 @@ +/* See LICENSE file for copyright and license details. */ +#include "libsimple.h" +#ifndef TEST + + +void * +libsimple_envmemalloc(int status, size_t n, va_list ap) /* TODO test (e[n][v]{mem,array}alloc) */ +{ + void *ret; + int saved_errno = errno; + errno = 0; + ret = libsimple_vmemalloc(n, ap); + if (errno) + enprintf(status, "libsimple_vmemalloc:"); + errno = saved_errno; + return ret; +} + + +#else +#include "test.h" + +int +main(void) +{ + return 0; +} + +#endif |