… | |
… | |
115 | } |
115 | } |
116 | |
116 | |
117 | //////////////////////////////////////////////////////////////////////////////// |
117 | //////////////////////////////////////////////////////////////////////////////// |
118 | // return: #bits of '1' |
118 | // return: #bits of '1' |
119 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) |
119 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) |
120 | # define bitcount(n) (__extension__ ({ uint32_t n__ = (n); __builtin_popcount (n); })) |
120 | # define bitcount(n) (__extension__ ({ uint32_t n__ = (n); __builtin_popcount (n__); })) |
121 | #else |
121 | #else |
122 | static int |
122 | static int |
123 | bitcount (uint16_t n) |
123 | bitcount (uint16_t n) |
124 | { |
124 | { |
125 | int i; |
125 | int i; |