Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Generals/Code/GameEngine/Include/Common/BitFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,19 @@ class BitFlags

for (int chunk = numChunks - 1; chunk >= 0; --chunk)
{
unsigned long long val = 0;
UnsignedInt64 val = 0;
for (int bit = 0; bit < 64 && (chunk * 64 + bit) < NUMBITS; ++bit)
{
if (m_bits.test(chunk * 64 + bit))
val |= (unsigned long long)(1) << bit;
val |= (UnsignedInt64)(1) << bit;
}

if (val != 0 || chunk == 0 || printedAny)
{
if (printedAny)
snprintf(chunkBuf, sizeof(chunkBuf), "%016llX", val);
snprintf(chunkBuf, sizeof(chunkBuf), "%016I64X", val);
else
snprintf(chunkBuf, sizeof(chunkBuf), "%llX", val);
snprintf(chunkBuf, sizeof(chunkBuf), "%I64X", val);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try "%" PRIx64

Copy link
Copy Markdown
Author

@Okladnoj Okladnoj May 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since <inttypes.h> does not exist in the MSVC 6.0 standard library, the compiler immediately fails in VC6 mode.

Here are the logs from CI:

Build GeneralsMD / vc6-debug+t+e
##[error]D:\a\GeneralsGameCode\GeneralsGameCode\GeneralsMD\Code\GameEngine\Include\Common/BitFlags.h(34) : fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory


result.concat(chunkBuf);
printedAny = true;
Expand Down
8 changes: 4 additions & 4 deletions GeneralsMD/Code/GameEngine/Include/Common/BitFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,19 @@ class BitFlags

for (int chunk = numChunks - 1; chunk >= 0; --chunk)
{
unsigned long long val = 0;
UnsignedInt64 val = 0;
for (int bit = 0; bit < 64 && (chunk * 64 + bit) < NUMBITS; ++bit)
{
if (m_bits.test(chunk * 64 + bit))
val |= (unsigned long long)(1) << bit;
val |= (UnsignedInt64)(1) << bit;
}

if (val != 0 || chunk == 0 || printedAny)
{
if (printedAny)
snprintf(chunkBuf, sizeof(chunkBuf), "%016llX", val);
snprintf(chunkBuf, sizeof(chunkBuf), "%016I64X", val);
else
snprintf(chunkBuf, sizeof(chunkBuf), "%llX", val);
snprintf(chunkBuf, sizeof(chunkBuf), "%I64X", val);

result.concat(chunkBuf);
printedAny = true;
Expand Down