开发者

Function Parameter is "#define"?

开发者 https://www.devze.com 2023-02-12 02:27 出处:网络
Something weird I\'ve never come across before. I wrote this function for on开发者_如何学JAVAe of my school projects:

Something weird I've never come across before. I wrote this function for on开发者_如何学JAVAe 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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消