mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-12-25 21:59:30 +01:00
- Fixed some warnings on Windows build
- Open the dictionary in binary mode. This fixes a bug in the Windows version of compdic
This commit is contained in:
parent
141442766b
commit
b4140b3fea
2 changed files with 3 additions and 2 deletions
|
@ -76,7 +76,7 @@ using namespace std;
|
||||||
|
|
||||||
const wchar_t* load_uncompressed(const string &iFileName, unsigned int &ioDicSize)
|
const wchar_t* load_uncompressed(const string &iFileName, unsigned int &ioDicSize)
|
||||||
{
|
{
|
||||||
ifstream file(iFileName.c_str());
|
ifstream file(iFileName.c_str(), ios::in | ios::binary);
|
||||||
if (!file.is_open())
|
if (!file.is_open())
|
||||||
throw DicException("Could not open file " + iFileName);
|
throw DicException("Could not open file " + iFileName);
|
||||||
|
|
||||||
|
@ -578,6 +578,5 @@ int main(int argc, char* argv[])
|
||||||
cerr << e.what() << endl;
|
cerr << e.what() << endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ int _swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...)
|
||||||
va_start(argp, format);
|
va_start(argp, format);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// Mingw32 does not take the maxlen argument
|
// Mingw32 does not take the maxlen argument
|
||||||
|
(void)maxlen;
|
||||||
res = vswprintf(wcs, format, argp);
|
res = vswprintf(wcs, format, argp);
|
||||||
#else
|
#else
|
||||||
res = vswprintf(wcs, maxlen, format, argp);
|
res = vswprintf(wcs, maxlen, format, argp);
|
||||||
|
@ -98,6 +99,7 @@ wchar_t *_wcstok(wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// Mingw32 does not take the third argument
|
// Mingw32 does not take the third argument
|
||||||
|
(void)ptr;
|
||||||
return wcstok(wcs, delim);
|
return wcstok(wcs, delim);
|
||||||
#else
|
#else
|
||||||
return wcstok(wcs, delim, ptr);
|
return wcstok(wcs, delim, ptr);
|
||||||
|
|
Loading…
Reference in a new issue