BeRo1985 / pasvulkan

Vulkan header generator, OOP-style API wrapper, framework and prospective Vulkan-based game engine for Object Pascal
zlib License
185 stars 28 forks source link

building "examples" fails on fpc #10

Closed WayneSherman closed 5 years ago

WayneSherman commented 5 years ago

Tested on Xubuntu 64-bit Linux ./projectmanager build examples

PasVulkan.Framework.pas(9699,14) Error: Can't determine which overloaded function to call PasVulkan.Framework.pas(21064) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted

Line in question: Alignment:=Max(fMemoryMinimumAlignment,VulkanDeviceSizeRoundUpToPowerOfTwo(aAlignment));

In the fpc Math unit there is not a Max function with QWORD arguments. https://www.freepascal.org/docs-html/rtl/math/max.html

The function in question might look like this:

function Max(a, b: QWORD): QWORD;inline;
begin
  if a > b then
    Result := a
    else
    Result := b;
end;

Does Delphi have an overloaded Max function with QWORD arguments?

BeRo1985 commented 5 years ago

Yes, Delphi has a overloaded function Max(a, b: UInt64): UInt64; function

BeRo1985 commented 5 years ago

So, it's fixed now

WayneSherman commented 5 years ago

Thanks. FYI I submitted a fpc bug report: https://bugs.freepascal.org/view.php?id=34364