Avoid redefining PRI macros on Linux (#4055)
* Avoid redefining `PRI` macros on Linux The fixed width 64-bit integer types are defined differently per platform. Some platforms define it as "long", others define it as "long long". For consistency, `AZ::u64` or `AZ::s64` is always defined to "long long". However, this causes problems for formatting those types, because on platforms where `uint64_t` is a `long`, `PRIu64` gives the wrong format string for `AZ::u64`. Previously this was fixed by redefining the `PRI` macros so that they work for `AZ::u64`, but that breaks the ability to format `uint64_t`. We could add an AZ-specific version of the `PRI` macros for 64-bit integer types, but we don't really need to, since they are `long long` on every platform we support. * Use `%ll` for `AZ::u64` * Use `PRIu64` for `uint64_t` Signed-off-by: Chris Burel <burelc@amazon.com> * Avoid redefining `PRI` macros in CryCommon Signed-off-by: Chris Burel <burelc@amazon.com>
This commit is contained in:
@@ -211,7 +211,7 @@ namespace Vegetation
|
||||
{
|
||||
return AZ::Failure(
|
||||
AZStd::string::format("The combination of View Area Grid Size and Sector Point Density will create %" PRId64 " instances. Only a max of %" PRId64 " instances is allowed.",
|
||||
static_cast<AZ::u64>(totalInstances), static_cast<AZ::u64>(s_maxVegetationInstances)));
|
||||
totalInstances, s_maxVegetationInstances));
|
||||
}
|
||||
|
||||
return AZ::Success();
|
||||
@@ -235,7 +235,7 @@ namespace Vegetation
|
||||
{
|
||||
return AZ::Failure(
|
||||
AZStd::string::format("The combination of View Area Grid Size and Sector Point Density will create %" PRId64 " instances. Only a max of %" PRId64 " instances is allowed.",
|
||||
static_cast<AZ::u64>(totalInstances), static_cast<AZ::u64>(s_maxVegetationInstances)));
|
||||
totalInstances, s_maxVegetationInstances));
|
||||
}
|
||||
|
||||
const float instancesPerMeter = static_cast<float>(sectorDensity) / static_cast<float>(m_sectorSizeInMeters);
|
||||
|
||||
Reference in New Issue
Block a user