diff options
Diffstat (limited to 'include/global.h')
-rw-r--r-- | include/global.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h index b8b118cd855..a58179e6759 100644 --- a/include/global.h +++ b/include/global.h @@ -281,6 +281,7 @@ typedef unsigned short ushort; #define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); } #define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); } #define test_all_bits(a,b) (((a) & (b)) == (b)) +#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1)) #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) #ifndef HAVE_RINT #define rint(A) floor((A)+0.5) |