Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#15696 closed defect (fixed)

LargeFileSize problem

Reported by: tsuchiya Owned by:
Priority: normal Milestone: 3.0.1
Component: wxMSW Version: 3.0.0
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

environment: tdm64-gcc-4.8.1

When file size is over 2GB, wxFFile::Length() return -1.

There was no problem at wxWidgets-2.9.x.

I'm sorry in poor English.

Change History (6)

comment:1 follow-up: Changed 8 months ago by vadz

Could you please check if wxHAS_HUGE_STDIO_FILES gets defined (as it is supposed to) in your build?

comment:2 in reply to: ↑ 1 Changed 8 months ago by tsuchiya

Replying to vadz:

Could you please check if wxHAS_HUGE_STDIO_FILES gets defined (as it is supposed to) in your build?

wxHAS_HUGE_STDIO_FILES isn't defined because wxCHECK_MINGW32_VERSION(3,5) macro is 0.

I think it's a matter of the order of include file.
In wx/platform.h file,
#include "wx/compiler.h" <--- refer MINGW32_MAJOR_VERSION, MINGW32_MINOR_VERSION.
#include "wx/msw/gccpriv.h" <--- define MINGW32_MAJOR_VERSION, MINGW32_MINOR_VERSION.

comment:3 Changed 8 months ago by vadz

  • Milestone set to 3.0.1
  • Status changed from new to confirmed

Oops. I thought __MINGW32_MAJOR_VERSION was predefined by the compiler but it is actually defined in <_mingw.h> which is indeed included too late.

Does the following patch fix it for you?

  • include/wx/compiler.h

    diff --git a/include/wx/compiler.h b/include/wx/compiler.h
    index 34a4718..a033c65 100644
    a b  
    140140 */ 
    141141 
    142142/* Check for Mingw runtime version: */ 
    143 #if defined(__MINGW32_MAJOR_VERSION) && defined(__MINGW32_MINOR_VERSION) 
     143#ifdef __MINGW32__ 
     144    /* Include the header defining __MINGW32_{MAJ,MIN}OR_VERSION */ 
     145    #include <_mingw.h> 
     146 
    144147    #define wxCHECK_MINGW32_VERSION( major, minor ) \ 
    145148 ( ( ( __MINGW32_MAJOR_VERSION > (major) ) \ 
    146149      || ( __MINGW32_MAJOR_VERSION == (major) && __MINGW32_MINOR_VERSION >= (minor) ) ) ) 

comment:4 Changed 8 months ago by tsuchiya

  • Resolution set to fixed
  • Status changed from confirmed to closed

Thank you.
This patch fixed the problem.

comment:5 Changed 8 months ago by VZ

(In [75304]) Fix wxCHECK_MINGW32_VERSION() definition.

Include _mingw.h before testing for MINGW32_MAJOR_VERSION as it's only
defined in that header.

Closes #15696.

comment:6 Changed 8 months ago by VZ

(In [75305]) Fix wxCHECK_MINGW32_VERSION() definition.

Include _mingw.h before testing for MINGW32_MAJOR_VERSION as it's only
defined in that header.

Closes #15696.

Note: See TracTickets for help on using tickets.