Mpzf.h “_BitScanForward64”: 找不到标识符

2023-07-08 14:49:30 浏览数 (2)

Mpzf.h “_BitScanForward64”: 找不到标识符

代码语言:javascript复制
inline int ctz (boost::uint64_t x) {
#ifdef _MSC_VER
	#ifdef _WIN64
			unsigned long ret;
			  _BitScanForward64(&ret, x);
			  return (int)ret;
		#else
				unsigned long ret;
			  _BitScanForward(&ret, x);
			  return (int)ret;
		#endif
  
#else
  // Assume long long is 64 bits
  return __builtin_ctzll (x);
#endif
}
inline int clz (boost::uint64_t x) {
#ifdef _MSC_VER
  #ifdef _WIN64
			unsigned long ret;
			  _BitScanReverse64(&ret, x);
			  return 63 - (int)ret;
		#else
				unsigned long ret;
			  _BitScanReverse(&ret, x);
			  return 63 - (int)ret;
		#endif
  
  
#else
  return __builtin_clzll (x);
#endif
}

0 人点赞