From b1a8b8a76be67d126172c1f29a0d1c74222cf694 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 9 Dec 2007 14:43:31 +0000 Subject: Fix for bug #1845876: MACOSX 10.2.8: sqrtf undefined svn-id: r29791 --- graphics/primitives.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'graphics/primitives.cpp') diff --git a/graphics/primitives.cpp b/graphics/primitives.cpp index 85a0383ea9..077af1c3a6 100644 --- a/graphics/primitives.cpp +++ b/graphics/primitives.cpp @@ -26,6 +26,13 @@ namespace Graphics { +#ifdef MACOSX +// Older versions of Mac OS X didn't supply a sqrtf function. To ensure +// binary compatibiity, we force using pow instead of sqrtf (the only +// potential drawback is that it might be a little bit slower). +#define sqrtf sqrt +#endif + void drawLine(int x0, int y0, int x1, int y1, int color, void (*plotProc)(int, int, int, void *), void *data) { // Bresenham's line algorithm, as described by Wikipedia const bool steep = ABS(y1 - y0) > ABS(x1 - x0); -- cgit v1.2.3