message: added a definition for __builtin_ctz/clz for Windows
diff: @@ -47,6 +47,29 @@ static inline int __builtin_clzll(unsigned long long mask) {
  #endif
  return 64; // Undefined Behavior.
  }
  +
  +static inline int __builtin_ctz(unsigned int value) {
  + DWORD trailing_zero = 0;
  +
  + if (_BitScanForward(&trailing_zero, value)) {
  + return trailing_zero;
  + } else {
  + // This is undefined, I better choose 32 than 0
  + return 32;
  + }
  +}
  +
  +static inline int __builtin_clz(unsigned int value) {
  + DWORD leading_zero = 0;
  +
  + if (_BitScanReverse(&leading_zero, value)) {
  + return 31 - leading_zero;
  + } else {
  + // Same remarks as above
  + return 32;
  + }
  +}
  +
  #endif
  static constexpr uint8_t BUFFER_SIZE = 128;
  