X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-compat-util.h;h=5d543d29f85e432a89bb8cbfbe2d18205599b06f;hb=2048bb00ee3937808ce9f0c8f59d71a9b46ab56f;hp=c353b276f0464714a4c0220b20df6318a374e28e;hpb=5df466c507ee2dd81c2e9002c3fedf3536cde0dc;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index c353b276..5d543d29 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1,6 +1,16 @@ #ifndef GIT_COMPAT_UTIL_H #define GIT_COMPAT_UTIL_H +#ifndef FLEX_ARRAY +#if defined(__GNUC__) && (__GNUC__ < 3) +#define FLEX_ARRAY 0 +#else +#define FLEX_ARRAY /* empty */ +#endif +#endif + +#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) + #include #include #include @@ -55,6 +65,11 @@ extern int gitfakemunmap(void *start, size_t length); extern int gitsetenv(const char *, const char *, int); #endif +#ifdef NO_UNSETENV +#define unsetenv gitunsetenv +extern void gitunsetenv(const char *); +#endif + #ifdef NO_STRCASESTR #define strcasestr gitstrcasestr extern char *gitstrcasestr(const char *haystack, const char *needle);