View Issue Details

IDProjectCategoryView StatusLast Update
0001135OpenMPTlibopenmptpublic2020-06-12 07:37
Reportermanx Assigned Tomanx  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionOpenMPT 1.27.09.00 / libopenmpt 0.3.11 (upgrade first) 
Target VersionOpenMPT 1.30.01.00 / libopenmpt 0.6.0 (upgrade first)Fixed in VersionOpenMPT 1.30.01.00 / libopenmpt 0.6.0 (upgrade first) 
Summary0001135: mpt::fstream is broken on MinGW for unicode filenames
Description

mpt::fstream converts wchar_t filenames to ANSI because MinGW does not support overloads for const wchar_t in std::fstream and friends.

Additional Information

A possible solution might be to make use of GCC libstdc++ specific __gnu_cxx::stdio_filebuf and use _wopen or similar under the hood.

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Relationships

related to 0001256 resolvedmanx require C++17 
child of 0000925 acknowledgedmanx Support for external samples in libopenmpt 

Activities

manx

manx

2018-08-02 15:21

administrator   ~0003585

There are also 2 "not-really-fixes" options to "fix" this:

  1. Wait for C++17 support, which includes std::filesystem support, which will handle unicode filenames properly. However, given GNU's attitude towards Windows, it will probably take close to forever to actually get std::filesystem support in MinGW.
  2. Remove iostreams for IO completely. We are actually not that far away from this option any more, since most member function calls on iostreams objects have already been converted to mpt::IO free functions which allow to trivially exchange the underlying file object type.
manx

manx

2019-05-03 14:35

administrator   ~0003935

libstd++ 9 supports opening wchar_t filenames on Windows. See https://gcc.gnu.org/gcc-9/changes.html .

manx

manx

2020-06-12 07:37

administrator   ~0004381

Fixed in r13012 for GCC>=9.1. Older GCC versions will now cause a warning for MinGW.

Issue History

Date Modified Username Field Change
2018-08-02 15:06 manx New Issue
2018-08-02 15:06 manx Status new => assigned
2018-08-02 15:06 manx Assigned To => manx
2018-08-02 15:07 manx Relationship added child of 0000925
2018-08-02 15:21 manx Note Added: 0003585
2019-05-03 14:34 manx Target Version => OpenMPT 1.?? (libopenmpt 1.0) (goals)
2019-05-03 14:35 manx Note Added: 0003935
2019-08-25 15:57 manx Relationship added related to 0001256
2020-04-21 18:52 manx Target Version OpenMPT 1.?? (libopenmpt 1.0) (goals) => OpenMPT 1.30.01.00 / libopenmpt 0.6.0 (upgrade first)
2020-06-12 07:37 manx Status assigned => resolved
2020-06-12 07:37 manx Resolution open => fixed
2020-06-12 07:37 manx Fixed in Version => OpenMPT 1.30.01.00 / libopenmpt 0.6.0 (upgrade first)
2020-06-12 07:37 manx Note Added: 0004381