Try to fix compilation under MSVC

__builtin_ctz() with bitmask == 0 is UB, so only do g_assert there.

svn path=/trunk/; revision=51176
This commit is contained in:
Jakub Zawadzki 2013-08-06 21:06:56 +00:00
parent 9cfac1227d
commit 97bddef1a2
1 changed files with 1 additions and 1 deletions

View File

@ -5546,9 +5546,9 @@ hfinfo_bitshift(const header_field_info *hfinfo)
{
const guint32 bitmask = hfinfo->bitmask;
#if defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
g_assert(bitmask != 0);
#if defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
return __builtin_ctz(bitmask);
#else
/* From http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightMultLookup */