GNOME Bugzilla – Bug 585215
Perl Glib 64bit test failing in MinGW
Last modified: 2010-04-24 22:22:25 UTC
Please describe the problem: MinGW may(*) use msvcrt.dll in which case the MS sscanf and printf are used, which means PORTABLE_LL_FORMAT can't contain the standard "l" and must contain "I64". That makes 64bit tests fail. If # ifdef __MSVCRT__ is used instead of # ifdef _MSC_VER when PORTABLE_LL_FORMAT and PORTABLE_ULL_FORMAT are defined in GType.xs, then the tests are passed. See similar problem I reported here: http://trac.osgeo.org/gdal/ticket/2649 Steps to reproduce: 1. Compile Glib in MinGW Perl which uses msvcrt.dll 2. Run tests 3. Actual results: 64bit tests fail Expected results: Does this happen every time? Other information:
Created attachment 136576 [details] [review] Check for _MSC_VER || __MSVCRT__ Judging from <http://msdn.microsoft.com/en-us/library/b0084kay.aspx>, the MS compiler doesn't seem to define __MSVCRT__. But how about checking for _MSC_VER || __MSVCRT__, as in this patch? Does this work for you too?
Ari, could you address the questions raised by Torsten? Thanks in advance!
Sorry for forgetting this. Hm. As it is in MinGW, the compiler is gcc and we need to check, which macros does it define. According to http://www.develer.com/oss/GccWinBinaries gcc in MinGW defines at least __MSVCRT_VERSION__ I'll get back to this later.
oh yes, the solution must work also for MS compilers. _MSC_VER || __MSVCRT__ looks like a solution to me.
Comment on attachment 136576 [details] [review] Check for _MSC_VER || __MSVCRT__ Alright, I committed this then.