X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=git-compat-util.h;h=09b0102cae8c8c0e39dc239003ca599a896730cf;hb=a1ccaedd62f7c23a8ec213afb691639f074be4de;hp=3a08d9916fb49b5a1578c74a5ae2949d98a8e699;hpb=bda53f4185b8f7d2197176fe83afcb8d5f47368b;p=thirdparty%2Fgit.git diff --git a/git-compat-util.h b/git-compat-util.h index 3a08d9916f..09b0102cae 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -180,9 +180,12 @@ #include #include #include -#ifndef NO_SYS_POLL_H +#if !defined(NO_POLL_H) +#include +#elif !defined(NO_SYS_POLL_H) #include #else +/* Pull the compat stuff */ #include #endif #ifdef HAVE_BSD_SYSCTL @@ -858,6 +861,7 @@ extern FILE *fopen_or_warn(const char *path, const char *mode); #define FREE_AND_NULL(p) do { free(p); (p) = NULL; } while (0) #define ALLOC_ARRAY(x, alloc) (x) = xmalloc(st_mult(sizeof(*(x)), (alloc))) +#define CALLOC_ARRAY(x, alloc) (x) = xcalloc((alloc), sizeof(*(x))); #define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), st_mult(sizeof(*(x)), (alloc))) #define COPY_ARRAY(dst, src, n) copy_array((dst), (src), (n), sizeof(*(dst)) + \