X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fxalloc.h;h=8668e198b7222b773a7e48573cccd05ed88e2bd2;hb=968fbdf8796db1bd5120865d8d2905bab6bd17fb;hp=38ae1d07d3d0ba10be1c1fd61b3567390f27c2ee;hpb=f8bf15285aa9296a754a394291d3e6a3f18ba71f;p=gnulib.git diff --git a/lib/xalloc.h b/lib/xalloc.h index 38ae1d07d..8668e198b 100644 --- a/lib/xalloc.h +++ b/lib/xalloc.h @@ -27,7 +27,7 @@ # endif # ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif # endif @@ -61,10 +61,10 @@ void *xcalloc PARAMS ((size_t n, size_t s)); void *xrealloc PARAMS ((void *p, size_t n)); char *xstrdup PARAMS ((const char *str)); -# define XMALLOC(Type, N_bytes) ((Type *) xmalloc (sizeof (Type) * (N_bytes))) -# define XCALLOC(Type, N_bytes) ((Type *) xcalloc (sizeof (Type), (N_bytes))) -# define XREALLOC(Ptr, Type, N_bytes) \ - ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_bytes))) +# define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items))) +# define XCALLOC(Type, N_items) ((Type *) xcalloc (sizeof (Type), (N_items))) +# define XREALLOC(Ptr, Type, N_items) \ + ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items))) /* Declare and alloc memory for VAR of type TYPE. */ # define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1)