From: Junio C Hamano Date: Wed, 16 May 2007 19:43:05 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.5.2~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fdcb769916c93b53517ef1b4cae447a3333c9b86;p=git.git Merge branch 'maint' * maint: format-patch: add MIME-Version header when we add content-type. Fixed link in user-manual import-tars: Use the "Link indicator" to identify directories git name-rev writes beyond the end of malloc() with large generations Documentation/branch: fix small typo in -D example --- fdcb769916c93b53517ef1b4cae447a3333c9b86 diff --cc git-compat-util.h index c08688c8f,7ed8b88b1..6bd8987b2 --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -13,14 -13,9 +13,17 @@@ #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) +#ifdef __GNUC__ +#define TYPEOF(x) (__typeof__(x)) +#else +#define TYPEOF(x) +#endif + +#define MSB(x, bits) ((x) & TYPEOF(x)(~0ULL << (sizeof(x) * 8 - (bits)))) + + /* Approximation of the length of the decimal representation of this type. */ + #define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) + #if !defined(__APPLE__) && !defined(__FreeBSD__) #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */