BeRo1985 / kraft

Kraft Physics Engine is an open source Object Pascal physics engine library that can be used in 3D games.
107 stars 21 forks source link

Fix compilation for Darwin i386, and hide "unused variable" notes #16

Closed michaliskambi closed 7 years ago

michaliskambi commented 7 years ago

Testing compilation of Kraft on Darwin (Mac OS X) i386, I got multiple errors like

kraft.pas(4243,30) Error: Generating PIC, but reference is not PIC-safe

That's probably because on Darwin, compiling with PIC is the default (see the bottom of http://wiki.freepascal.org/PIC_information ). This pull request simply avoids defining CPU386ASMForSinglePrecision in this case.

Also, I added {$notes off}. Compiling Kraft.pas with notes enabled currently produces 37 notes about unused variables :)

kraft.pas(14151,27) Note: Local variable "NewStart" is assigned but never used
kraft.pas(14153,6) Note: Local variable "ti" is assigned but never used

It's not a big deal of course, but it makes the compiler output less useful when compiling a larger application with Kraft.pas inside.

BeRo1985 commented 7 years ago