diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-08-23 14:43:07 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-08-23 14:43:07 +0000 |
| commit | da7658fa7f09d0ea25b4fea537b0ca03f8700d74 (patch) | |
| tree | d45852c0f8615daa0ddafa138fe7ff1f6d4666ac /src | |
| parent | 2c22cfd94a6b46515f4dd23ecb5f5589c31e2b7d (diff) | |
Avoiding problems with some platforms that don't implement hypot() (STR #1366)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5349 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/fl_arc.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/fl_arc.cxx b/src/fl_arc.cxx index 08cc416bf..cbbe2bab7 100644 --- a/src/fl_arc.cxx +++ b/src/fl_arc.cxx @@ -32,11 +32,12 @@ #include <FL/fl_draw.H> #include <FL/math.h> -#if defined(WIN32) && !defined(__CYGWIN__) -// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs -// on Windows, which is supposed to be POSIX compliant... -# define hypot _hypot -#endif // WIN32 && !__CYGWIN__ +// avoid problems with some platforms that don't +// implement hypot. +static double _fl_hypot(double x, double y) { + return sqrt(x*x + y*y); +} + void fl_arc(double x, double y, double r, double start, double end) { @@ -50,10 +51,10 @@ void fl_arc(double x, double y, double r, double start, double end) { // Maximum arc length to approximate with chord with error <= 0.125 double epsilon; { - double r1 = hypot(fl_transform_dx(r,0), // Horizontal "radius" - fl_transform_dy(r,0)); - double r2 = hypot(fl_transform_dx(0,r), // Vertical "radius" - fl_transform_dy(0,r)); + double r1 = _fl_hypot(fl_transform_dx(r,0), // Horizontal "radius" + fl_transform_dy(r,0)); + double r2 = _fl_hypot(fl_transform_dx(0,r), // Vertical "radius" + fl_transform_dy(0,r)); if (r1 > r2) r1 = r2; // r1 = minimum "radius" if (r1 < 2.) r1 = 2.; // radius for circa 9 chords/circle |
