From de2c5bfa19ce6b3fda50bca3445aabc040947bc9 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Thu, 3 Mar 2011 16:34:43 -0500 Subject: [PATCH] Add an implementation of fmax for use with MSVC --- src/cairo-compiler-private.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h index e25ee1fdf..4349b87e3 100644 --- a/src/cairo-compiler-private.h +++ b/src/cairo-compiler-private.h @@ -227,6 +227,20 @@ ffs (int x) return 0; } +#define _USE_MATH_DEFINES + +#include + +static inline double +fmax (double a, double b) +{ + if (_isnan(a)) + return b; + if (_isnan(b)) + return a; + return a > b ? a : b; +} + #endif #if defined(_MSC_VER) && defined(_M_IX86)