diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-10 14:07:18 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-11 15:36:06 -0800 |
commit | 8d85bd1e2f9473958b235caf7af9913b518f73dd (patch) | |
tree | 3348aa708638b6dbe31e9b1ca17d49465df85e8d /utils.h | |
parent | e02e32f71f6c24fcc69bdaf58f6f9e973a017896 (diff) |
Replace uTypedRecalloc() with direct recallocarray() calls
Retains uRecalloc() as a fallback for platforms without recallocarray()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -80,16 +80,19 @@ typedef int Comparison; #define reallocarray(p, n, s) realloc(p, (n) * (s)) #endif -extern Opaque uRecalloc(Opaque /* old */ , - unsigned /* nOld */ , - unsigned /* nNew */ , - unsigned /* newSize */ +#ifndef HAVE_RECALLOCARRAY +#define recallocarray uRecalloc + +extern void *uRecalloc(void * /* old */ , + size_t /* nOld */ , + size_t /* nNew */ , + size_t /* newSize */ ); +#endif + extern void uFree(Opaque /* ptr */ ); -#define uTypedRecalloc(pO,o,n,t) ((t *)uRecalloc((Opaque)pO,((unsigned)o),((unsigned)n),sizeof(t))) - /***====================================================================***/ extern Boolean uSetErrorFile(char * /* name */ |