From f90d5c574cba21880fecf57f844dacb6097a242f Mon Sep 17 00:00:00 2001 From: oehhar Date: Fri, 4 Oct 2019 07:07:35 +0000 Subject: Bug in float emulation for MS-VC6: map fabsf() to fabs(), not abs(). Add float emulation for MS-VC8. Thanks to Auriocus to point out the bug. --- generic/nanosvg.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generic/nanosvg.h b/generic/nanosvg.h index ade6ec7..b449dc2 100755 --- a/generic/nanosvg.h +++ b/generic/nanosvg.h @@ -91,13 +91,17 @@ extern "C" { #define cosf(a) (float)cos(a) #define sinf(a) (float)sin(a) #define sqrtf(a) (float)sqrt(a) -#define fabsf(a) (float)abs(a) +#define fabsf(a) (float)fabs(a) #define acosf(a) (float)acos(a) #define atan2f(a,b) (float)atan2(a,b) #define ceilf(a) (float)ceil(a) #define fmodf(a,b) (float)fmod(a,b) #define floorf(a) (float)floor(a) #endif +// float emulation for MS VC8++ compiler +#if (_MSC_VER == 1400) +#define fabsf(a) (float)fabs(a) +#endif enum NSVGpaintType { NSVG_PAINT_NONE = 0, -- cgit v0.12