Browse Source

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 year ago
parent
commit
6862de6d14
1 changed files with 4 additions and 0 deletions
  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)
 {
+#if defined(_M_ARM64)
+	return _CountTrailingZeros(val);
+#else
 	return _tzcnt_u32(val);
+#endif
 }
 #else
 static uint32_t popcnt(uint32_t x)