Recent

Author Topic: SDL2: Runtime Error 216 on MacOS-arm  (Read 2015 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3478
    • StrumPract is the musicians best friend
Re: SDL2: Runtime Error 216 on MacOS-arm
« Reply #15 on: January 15, 2025, 07:04:42 pm »
After adding the exception "exOverflow", it worked. The exception "exZeroDivide" could then be removed. Thanks for this.
Can the code remain like this or is there a way to fix this properly? Does this hint to a bug in libSDL2?

I tested your code under Linux amd64 and it works.
About exception, I suppose you know the trick:

Code: Pascal  [Select][+][-]
  1. ...
  2.  
  3. uses math, ...
  4. ...
  5.  
  6. begin
  7.  SetExceptionMask(GetExceptionMask + [exZeroDivide] + [exInvalidOp] +
  8.     [exDenormalized] + [exOverflow] + [exUnderflow] + [exPrecision]);
  9. ...
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

TRon

  • Hero Member
  • *****
  • Posts: 3946
Re: SDL2: Runtime Error 216 on MacOS-arm
« Reply #16 on: January 15, 2025, 07:44:59 pm »
i think its fpc bug , i run into this situation with win10 64bits & sdl2 & fpc , i did try with other languages on this system and every thing works fine except fpc
It is not exactly a bug but a feature, see wiki (check the link as well)

fwiw: for gtk appliciations for aarch64 this was already reported and fixed in trunk.
« Last Edit: January 15, 2025, 07:47:48 pm by TRon »
I do not have to remember anything anymore thanks to total-recall.

 

TinyPortal © 2005-2018