It seems mingw tries to include stdlib.h after windef.h in the build process and that was the result of the warnings/error.
By making this change I don't have to change any of the other headers That depend on MAX_PATH (winnls,wingdi) by adding stdlib.h in them. I don't know if its right by the wine project standards but now I can compile 90% of the wine dll sources without warrnings/errors from stupid MAX_PATH. If someone has a better way please cvs diff -u me =)
Thanks Steven
Changelog: Fix the MAX_PATH mess under Mingw. (for real this time)
cvs diff -u windef.h Index: windef.h =================================================================== RCS file: /home/wine/wine/include/windef.h,v retrieving revision 1.62 diff -u -r1.62 windef.h --- windef.h 10 Mar 2002 00:02:34 -0000 1.62 +++ windef.h 30 Apr 2002 21:41:42 -0000 @@ -149,6 +149,10 @@ #endif #endif /* NOMINMAX */
+#ifdef __MINGW__ +#include <stdlib.h> +#else + #ifndef _MAX_PATH /* FIXME: These are supposed to be in stdlib.h only */ #define _MAX_DRIVE 3 @@ -156,9 +160,13 @@ #define _MAX_DIR _MAX_FNAME #define _MAX_EXT _MAX_FNAME #define _MAX_PATH 260 -#endif +#endif /* _MAX_PATH */ + +#ifndef MAX_PATH #define MAX_PATH _MAX_PATH +#endif /* MAX_PATH */
+#endif /* __MINGW__ */
#define HFILE_ERROR ((HFILE)-1)
"Steven Edwards" Steven_Ed4153@yahoo.com writes:
By making this change I don't have to change any of the other headers That depend on MAX_PATH (winnls,wingdi) by adding stdlib.h in them. I don't know if its right by the wine project standards but now I can compile 90% of the wine dll sources without warrnings/errors from stupid MAX_PATH. If someone has a better way please cvs diff -u me =)
I have committed a different fix that I think should work too, please give it a try. We should be 100% Windows-compatible now so if it still doesn't work I'd say the problem is in Mingw.
I have committed a different fix that I think should work too, please give it a try. We should be 100% Windows-compatible now so if it still doesn't work I'd say the problem is in Mingw.
Your fix worked for all of the missing MAX_PATH errors in winnls.h and wingdi.h but I still get one warning every once and a while.
../include/windef.h:155: warning: `MAX_PATH' redefined /usr/include/mingw/stdlib.h:62: warning: this is the location of the previous de finition
Is this a mingw problem? If so I wil go talk to them, if not then it just needs This before the MAX_PATH define.
#ifdef __MINGW__ #undef MAX_PATH #endif /* __MINGW__ */
In any case I can live with this warning now that the errors are gone. Thanks For the help so far. Steven
"Every revolution was once a thought in one man's mind" - Ralph Waldo Emerson
"Steven Edwards" Steven_Ed4153@yahoo.com writes:
Is this a mingw problem? If so I wil go talk to them, if not then it just needs This before the MAX_PATH define.
IMO it's a mingw problem, stdlib.h is not supposed to define MAX_PATH, only _MAX_PATH.
IMO it's a mingw problem, stdlib.h is not supposed to define MAX_PATH, only _MAX_PATH.
Ok thanks, I'll go bug them for a while.
Steven
"Every revolution was once a thought in one man's mind" - Ralph Waldo Emerson