diff options
author | Jeff Muizelaar <jmuizelaar@mozilla.com> | 2011-03-03 16:34:43 -0500 |
---|---|---|
committer | Jeff Muizelaar <jmuizelaar@mozilla.com> | 2011-03-03 16:34:43 -0500 |
commit | de2c5bfa19ce6b3fda50bca3445aabc040947bc9 (patch) | |
tree | 2d1b5477e7906f04e8cb190bd9ff91a56d196f53 /src/cairo-compiler-private.h | |
parent | aca492eb3f4a0d472e6fdb2e4dac9d52edefbff9 (diff) | |
download | cairo-de2c5bfa19ce6b3fda50bca3445aabc040947bc9.tar.gz |
Add an implementation of fmax for use with MSVC
Diffstat (limited to 'src/cairo-compiler-private.h')
-rw-r--r-- | src/cairo-compiler-private.h | 14 |
1 files changed, 14 insertions, 0 deletions
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 <float.h> + +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) |