diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-06 17:42:04 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-01-01 14:34:57 -0800 |
commit | 40bcc8c3303a858c786f1d6d04ae5bbdec6b04ff (patch) | |
tree | 1d6ad569496120004426e60a8c6d40b7584700d6 /def.h | |
parent | 47f2e64d865568d4f00cb97e42ad5cfc47e9c161 (diff) |
Use reallocarray() on systems that provide it
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'def.h')
-rw-r--r-- | def.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -38,6 +38,11 @@ in this Software without prior written authorization from The Open Group. #include <fcntl.h> #include <sys/stat.h> +#ifndef HAVE_REALLOCARRAY +#define reallocarray(ptr, num, size) realloc(ptr, (num) * (size)) +#endif +#define mallocarray(num, size) reallocarray(NULL, num, size) + #define MAXDEFINES 512 #define MAXFILES 2048 #define MAXINCFILES 128 /* "-include" files */ |