Jesse Jashinsky
Jesse Jashinsky

Reputation: 10673

Function Parameter is "#define"?

Something weird I've never come across before. I wrote this function for one of my school projects:

void j_glOrtho(int left, int right, int bottom, int top, float near, float far)

For some reason Microsoft Visual C++ says that near and far are #define instead of float. As a result, I get a compiler error when I try to use them as floats. Anyone know what's going on?

Upvotes: 0

Views: 41

Answers (1)

icktoofay
icktoofay

Reputation: 129109

I believe it's some legacy compatibility for DOS and 16-bit things. I'm not sure if this will work, but try it:

#ifdef near
#undef near
#endif
#ifdef far
#undef far
#endif

Upvotes: 3

Related Questions