Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-08

FPC 2.3.1 on Mac OS X?

8 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Damien Gerard
to Paul
Paul wrote
Hi, I've read that there are some issues with FPC 2.2.0 on Mac OSX. Is it save to install version 2.3.1 already ?

I use FPC from the snapshots (http://snapshots.lazarus.shikami.org/lazarus/ ) so it is fpc 2.2.2 and it really works fine for me (it is the latest stable version).
The last time I checked there were still issues with generics however it is not something absolutely needed

Damien Gerard Si ces robots s'humanisaient, inversement les êtres humains se robotiseraient-ils ?

Reply by email

Jonas Maebe
to Paul: I've read that there are some issues with FPC 2.2.0 on Mac OSX. Is it save to install…
Paul wrote
I've read that there are some issues with FPC 2.2.0 on Mac OSX.

There are some issues with compiling programs with FPC 2.2.0 under Mac OS X 10.5.x, and on all Mac OS X systems with case-sensitive file systems. Programs compiled with 2.2.0 under Mac OS X 10.4.x however work fine under Mac OS X 10.5.x.

FPC 2.2.2 resolves all those problems (but also see http://bugs.freepascal.org/view.php?id=12001 ).

Is it save to install version 2.3.1 already ?

It depends from which day, as it's a constantly changing version. It's better to use FPC 2.2.2, the latest official release.

Jonas

Reply by email

EarMaster - Bent Olsen
to Jonas Maebe

Hi all,

Is there any precautions one should make when sharing FPC codes between i386 and PowerPC?

I've few calls to AudioToolbox API's which works fine under i386, but crashes in PPC - the exact API call is AudioConverterNew, and the records passed to the API looks good, and is also returned by AudioToolbox itself.

It doesn't return an error code - just crashes with EXC_ARITHMETIC error in a procedure called SincKernel::CalculateFilterCoefficients.

Any hints will be much appreciated.

Best regards,
Normann

Reply by email

Jonas Maebe
to EarMaster - Bent Olsen
EarMaster - Bent Olsen wrote 13 lines
Is there any precautions one should make when sharing FPC codes between i386 and PowerPC? I've few calls to AudioToolbox API's which works fine under i386, but crashes in PPC - the exact API call is AudioConverterNew, and the records passed to the API looks good, and is also returned by AudioToolbox itself. It doesn't return an error code - just crashes with EXC_ARITHMETIC error in a procedure called SincKernel::CalculateFilterCoefficients.

First of all: when starting a new thread, please write a new message to the mailing list rather than replying to an existing one and changing the subject. Such replies mess up automatic threading both in the web archive and in various mail clients.

That said, the crash you get is caused by a floating point arithmetic error (one of many) in Apple's system frameworks (which also exist in several OpenGL implementations for Windows, in GTK2 etc). These do not cause any problems in most C programs, because in C programs by default all floating point exceptions are masked (and hence no one ever notices such errors).

You can mask them in FPC as well by adding the "math" unit to your uses clause and performing the following call at the start of your program:

SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision])

Note that this will mask all floating point exceptions everywhere, i.e., also in your Pascal code. The only alternative is to save, change and restore the floating point exception mask around every call to a system routine directly or indirectly related to audio or graphics.

Jonas

Reply by email

EarMaster - Bent Olsen
to Jonas Maebe
Show quoted text 27 lines
-----Original Message----- From: [mailto:fpc-pascal- On Behalf Of Jonas Maebe Sent: 29. september 2008 10:46 To: FPC-Pascal users discussions Subject: Re: [fpc-pascal] Carbon: i386 vs PPC API's On 29 Sep 2008, at 09:27, EarMaster - Bent Olsen wrote: > Is there any precautions one should make when sharing FPC codes > between i386 > and PowerPC? > > I've few calls to AudioToolbox API's which works fine under i386, but > crashes in PPC - the exact API call is AudioConverterNew, and the > records > passed to the API looks good, and is also returned by AudioToolbox > itself. > > It doesn't return an error code - just crashes with EXC_ARITHMETIC > error in > a procedure called SincKernel::CalculateFilterCoefficients. First of all: when starting a new thread, please write a new message to the mailing list rather than replying to an existing one and changing the subject. Such replies mess up automatic threading both in the web archive and in various mail clients.

Noted! Sorry, I wasn't aware of this.

Show quoted text 10 lines
That said, the crash you get is caused by a floating point arithmetic error (one of many) in Apple's system frameworks (which also exist in several OpenGL implementations for Windows, in GTK2 etc). These do not cause any problems in most C programs, because in C programs by default all floating point exceptions are masked (and hence no one ever notices such errors). You can mask them in FPC as well by adding the "math" unit to your uses clause and performing the following call at the start of your program:

Thanks! I did this, and it works like a charm ;-)

Show quoted text 10 lines
SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]) Note that this will mask all floating point exceptions everywhere, i.e., also in your Pascal code. The only alternative is to save, change and restore the floating point exception mask around every call to a system routine directly or indirectly related to audio or graphics. Jonas

Reply by email