After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 585215 - Perl Glib 64bit test failing in MinGW
Perl Glib 64bit test failing in MinGW
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Glib
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2009-06-09 05:12 UTC by Ari Jolma
Modified: 2010-04-24 22:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check for _MSC_VER || __MSVCRT__ (517 bytes, patch)
2009-06-14 18:56 UTC, Torsten Schoenfeld
committed Details | Review

Description Ari Jolma 2009-06-09 05:12:47 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:
Comment 1 Torsten Schoenfeld 2009-06-14 18:56:28 UTC
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?
Comment 2 Tobias Mueller 2010-04-21 17:41:34 UTC
Ari, could you address the questions raised by Torsten? Thanks in advance!
Comment 3 Ari Jolma 2010-04-22 05:41:50 UTC
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.
Comment 4 Ari Jolma 2010-04-22 05:46:01 UTC
oh yes, the solution must work also for MS compilers. _MSC_VER || __MSVCRT__ looks like a solution to me.
Comment 5 Torsten Schoenfeld 2010-04-24 22:22:07 UTC
Comment on attachment 136576 [details] [review]
Check for _MSC_VER || __MSVCRT__

Alright, I committed this then.