Updated the Munt code to 2.4.0 (port from VARCem).

This commit is contained in:
OBattler
2020-06-07 02:06:15 +02:00
parent e109a59a56
commit b2a7a5b90f
74 changed files with 747 additions and 310 deletions

View File

@@ -1,5 +1,5 @@
/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher
* Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev
* Copyright (C) 2011-2020 Dean Beeler, Jerome Fisher, Sergey V. Mikayev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -15,12 +15,26 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef MT32EMU_SHARED
#include <locale>
#endif
#include "internals.h"
#include "FileStream.h"
namespace MT32Emu {
static inline void configureSystemLocale() {
#ifdef MT32EMU_SHARED
static bool configured = false;
if (configured) return;
configured = true;
std::locale::global(std::locale(""));
#endif
}
using std::ios_base;
FileStream::FileStream() : ifsp(*new std::ifstream), data(NULL), size(0)
@@ -70,6 +84,7 @@ const Bit8u *FileStream::getData() {
}
bool FileStream::open(const char *filename) {
configureSystemLocale();
ifsp.clear();
ifsp.open(filename, ios_base::in | ios_base::binary);
return !ifsp.fail();