浏览代码

obs-outputs: Use _CountTrailingZeros() in ctz32 for ARM64

This change modifies the `ctz32` function to use `_CountTrailingZeros`
when `_M_ARM64` is defined, as `_tzcnt_u32` is not available on WOA.
thirumalai-qcom 1 年之前
父节点
当前提交
6862de6d14
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      plugins/obs-outputs/utils.h

+ 4 - 0
plugins/obs-outputs/utils.h

@@ -22,7 +22,11 @@ static inline uint32_t clz32(unsigned long val)
 
 
 static inline uint32_t ctz32(unsigned long val)
 static inline uint32_t ctz32(unsigned long val)
 {
 {
+#if defined(_M_ARM64)
+	return _CountTrailingZeros(val);
+#else
 	return _tzcnt_u32(val);
 	return _tzcnt_u32(val);
+#endif
 }
 }
 #else
 #else
 static uint32_t popcnt(uint32_t x)
 static uint32_t popcnt(uint32_t x)