bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2001-2018 Dovecot authors, see the included COPYING file */
0dac2f5f0a0f25d8f6b789ba089f1a2d01c529a6Josef 'Jeff' Sipek * We could use bits_required64() unconditionally, but that's unnecessary
0dac2f5f0a0f25d8f6b789ba089f1a2d01c529a6Josef 'Jeff' Sipek * and way more heavy weight on 32-bit systems.
0dac2f5f0a0f25d8f6b789ba089f1a2d01c529a6Josef 'Jeff' Sipek#define BITS_REQUIRED(x) bits_required64(x)
0dac2f5f0a0f25d8f6b789ba089f1a2d01c529a6Josef 'Jeff' Sipek#define BITS_REQUIRED(x) bits_required32(x)
3637a2ad3b2ead17efd5591f73effd3b140d8d2dPhil Carmody i_assert(num <= ((size_t)1 << (CHAR_BIT*sizeof(size_t) - 1)));
0913e6eb7b5d87a5323440dc6644f7347c360857Timo Sirainen#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
84f697c5e30565823619abaaeb57164c789d4b66Phil Carmody/* Lucky you, it's all inline intrinsics */