danfis / libccd

Library for collision detection between two convex shapes
Other
478 stars 108 forks source link

building with MSVC++, missing fmin/fminf/fmax/fmaxf #5

Closed jzxu closed 11 years ago

jzxu commented 11 years ago

Hi,

I'm trying to build libccd in Windows using MSVC++. Everything seems to work fine except the MS compiler doesn't have any C99 features and is thus missing fmin/fminf/fmax/fmaxf. If I just change CCD_FMIN and CCD_FMAX to inline functions:

__inline ccd_real_t CCD_FMAX(ccd_real_t x, ccd_real_t y) { return x < y ? y : x; } __inline ccd_real_t CCD_FMIN(ccd_real_t x, ccd_real_t y) { return x < y ? x : y; }

then the library compiles fine (please ignore the weird __inline syntax, I'm still trying to figure out a portable way to specify inline). I'm not suggesting this is the ideal solution, but I think a similar change is worthwhile to get the library to compile on Windows without modification.

jzxu commented 11 years ago

Oops, didn't see that this was already fixed. Sorry about the noise.