Description

Reported here:

[Link Removed]

> See this commit:
>
> https://github.com/EpicGames/UnrealEngine/commit/acd754e12dc9a7ffc7f173c8433a6bafc0262b51#diff-b18d4f9b879748fdacff2caa885b231e8c9e0b899d90d5dfe3b3c06c191a6770R71
>
> It adds a #define for TWO_PI, PI_SQUARED, and others. This is painful because it prevents the use of the name "TWO_PI" in any code that includes UnrealMathUtility.h. And can produce some really weird compiler errors. And worse, it is single precision while the rest of Unreal Engine is headed toward double precision (though there is a double-precision version below it).
>
> I'm not sure if it's ok to use constexpr in UE5, but, if not, maybe these new #define's could at least be prefixed with "UE", as some of the others in this file already are? Anyone that has ever experienced the pain of trying to use MIN or MAX in a file that includes windows.h knows how important it is to be careful in naming #define's.

Our coding standard says that macros should have a UE_ prefix:

https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/DevelopmentSetup/CodingStandard/#namespaces

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-140139 in the post.

0
Login to Vote

Unresolved
ComponentUE - Foundation - Core
Target Fix5.5
Main Commit19681434
CreatedJan 25, 2022
UpdatedApr 18, 2024