UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MacPlatformMath.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================================
4 MacPlatformMath.h: Mac platform Math functions
5==============================================================================================*/
6
7#pragma once
10
11
12#if PLATFORM_MAC_X86
13 #include <smmintrin.h>
15
16 /*
17 * Mac implementation of the Math OS functions
18 **/
19 struct FMacPlatformMath : public TUnrealPlatformMathSSE4Base<FClangPlatformMath>
20 {
21 #if PLATFORM_ENABLE_POPCNT_INTRINSIC
25 static UE_FORCEINLINE_HINT int32 CountBits(uint64 Bits)
26 {
27 return __builtin_popcountll(Bits);
28 }
29 #endif
30
31 static UE_FORCEINLINE_HINT bool IsNaN( float A ) { return isnan(A) != 0; }
32 static UE_FORCEINLINE_HINT bool IsNaN(double A) { return isnan(A) != 0; }
33 static UE_FORCEINLINE_HINT bool IsFinite(float A) { return isfinite(A); }
34 static UE_FORCEINLINE_HINT bool IsFinite(double A) { return isfinite(A); }
35 };
36
38#else
39 typedef FClangPlatformMath FPlatformMath;
40#endif
41
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FClangPlatformMath FPlatformMath
Definition MacPlatformMath.h:39
Definition UnrealPlatformMathSSE4.h:70