|
@@ -1,18 +1,6 @@
|
|
|
#ifndef GIT_COMPAT_UTIL_H
|
|
#ifndef GIT_COMPAT_UTIL_H
|
|
|
#define GIT_COMPAT_UTIL_H
|
|
#define GIT_COMPAT_UTIL_H
|
|
|
|
|
|
|
|
-#ifdef __GNUC__
|
|
|
|
|
-#define TYPEOF(x) (__typeof__(x))
|
|
|
|
|
-#else
|
|
|
|
|
-#define TYPEOF(x)
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-#define MSB(x, bits) ((x) & TYPEOF(x)(~0ULL << (sizeof(x) * 8 - (bits))))
|
|
|
|
|
-#define HAS_MULTI_BITS(i) ((i) & ((i) - 1)) /* checks if an integer has more than 1 bit set */
|
|
|
|
|
-
|
|
|
|
|
-/* Approximation of the length of the decimal representation of this type. */
|
|
|
|
|
-#define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
|
|
|
|
|
-
|
|
|
|
|
#define _ALL_SOURCE 1
|
|
#define _ALL_SOURCE 1
|
|
|
#define _BSD_SOURCE 1
|
|
#define _BSD_SOURCE 1
|
|
|
/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */
|
|
/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */
|