[ODE] 0.6 Release
Rodrigo Hernandez
kwizatz at aeongames.com
Sun May 14 17:53:28 MST 2006
Ok, found how to tell VC++ 6 on a preprocessor directive, according to
this page:
http://www.datafocus.com/docs/man1/cpp.1.asp
_MSC_VER
defines the compiler version for the versions supported by the
current version of MKS Toolkit. Possible values include:
Microsoft Visual C++ 7.1 _MSC_VER = 1310
Microsoft Visual C++ 7.0 _MSC_VER = 1300
Microsoft Visual C++ 6.0 _MSC_VER = 1200
Microsoft Visual C++ 5.0 _MSC_VER = 1100
So
#if (_MSC_VER <= 1200)
#define MIN(A,B) ((A>B) ? B:A)
#define MAX(A,B) ((A>B) ? A:B)
#else
#define MIN(A,B) std::min(A,B)
#define MAX(A,B) std::max(A,B)
#endif
should do the trick.
Rodrigo Hernandez wrote:
>Of the top of my head it occurs to me that you could do
>
>using namespace std;
>
>and then remove the std:: prefixes, that way VC6 would use ::min and
>::max instead of std::min and std::max.
>
>I preffer the std:: prefix because that way you know exactly which
>version of the function you're calling,
>but I guess we can sacrifice that.
>
>Also, you could check for VC6 on a preprocessor directive and define MIN
>and MAX:
>
>#if (check for MSC Version here)
>#define MIN(A,B) ((A>B) ? B:A)
>#define MAX(A,B) ((A>B) ? A:B)
>#else
>#define MIN(A,B) std::min(A,B)
>#define MAX(A,B) std::max(A,B)
>#endif
>
>and replace all std:: instances with either MIN or MAX
>
>Jason Perkins wrote:
>
>
>
>>I just got an email stating that convex.cpp does not build on VC6. I
>>tried it myself, and it is complaining that 'min' and 'max' are not in
>>the 'std' namespace. A quick google shows that VC6 indeed does have an
>>issue with these functions. Does anyone have a workaround for this? I
>>would be willing to apply and test.
>>
>>Thanks!
>>
>>Jason
>>
>>_______________________________________________
>>ODE mailing list
>>ODE at q12.org
>>http://q12.org/mailman/listinfo/ode
>>
>>
>>
>>
>>
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>
>
More information about the ODE
mailing list