Re: Overriding libSystem's math functions
Re: Overriding libSystem's math functions
- Subject: Re: Overriding libSystem's math functions
- From: Mike Blaguszewski <email@hidden>
- Date: Mon, 11 Dec 2006 14:35:41 -0500
On Dec 11, 2006, at 2:17 PM, Greg Guerin wrote:
What do you intend to achieve by doing this? At what cost?
The application is a multiplayer simulation game, which I'm porting
to the Mac. The simulation needs to stay basically in sync (no
cumulative errors) over the course of the game. It already works fine
PC<->PC, since the binaries are identical, but PC<->Mac or even PPC<-
>Intel is harder.
The game is mostly graphics-bound, so taking a hit in FP performance
is probably okay. Since this is a port of an existing app, I'm trying
to do the easiest reasonable thing that will work.
You could define macros for all the standard functions that call your
custom functions:
#define sin(x) foosin(x)
#define cos(x) foocos(x)
If you put those in your own local "foomath.h" header, then your code
#includes that file rather than <math.h>. Your source can still be
written
as if it used the standard functions sin(), cos(), etc.
I think this is the probably the way to I'm going to have to go, as
the MS Visual C++ linker is less forgiving. Though even then it seems
like higher-level optimizations could cause differences between gcc
and MSVC, despite forcing strict IEEE math.
--
Mike Blaguszewski / Cocoa Hacker / Ambrosia Software, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden