applied patch #2497172 - Fixes for POSIX build on Solaris, plus a regression

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5907 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2009-01-17 22:32:19 +00:00
parent 5199b3bd65
commit a8d988b5c0
4 changed files with 9 additions and 6 deletions

View file

@ -312,7 +312,7 @@ void MMapFile::release()
#ifdef _WIN32 #ifdef _WIN32
UnmapViewOfFile(m_pView); UnmapViewOfFile(m_pView);
#else #else
munmap(m_pView, m_iMappedSize); munmap((char *)m_pView, m_iMappedSize);
#endif #endif
m_pView = NULL; m_pView = NULL;
} }
@ -328,7 +328,7 @@ void MMapFile::release(void *pView, int size)
#ifdef _WIN32 #ifdef _WIN32
UnmapViewOfFile(pView); UnmapViewOfFile(pView);
#else #else
munmap(pView, size); munmap((char *)pView, size);
#endif #endif
} }
@ -338,7 +338,7 @@ void MMapFile::flush(int num)
#ifdef _WIN32 #ifdef _WIN32
FlushViewOfFile(m_pView, num); FlushViewOfFile(m_pView, num);
#else #else
msync(m_pView, num, MS_SYNC); msync((char *)m_pView, num, MS_SYNC);
#endif #endif
} }

View file

@ -22,6 +22,7 @@
#ifndef _WIN32 #ifndef _WIN32
#include <cstdio> // for FILE* #include <cstdio> // for FILE*
#include <fstream> // (some systems have FILE* in here)
#endif #endif
class IMMap class IMMap

View file

@ -19,6 +19,7 @@
#include "Platform.h" #include "Platform.h"
#include <cstdio> #include <cstdio>
#include <fstream>
#include "growbuf.h" #include "growbuf.h"
class StringList class StringList

View file

@ -29,6 +29,7 @@
# include <unistd.h> // for close(2) # include <unistd.h> // for close(2)
# include <fcntl.h> // for open(2) # include <fcntl.h> // for open(2)
# include <iconv.h> # include <iconv.h>
# include <locale.h>
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
@ -179,7 +180,7 @@ int wsprintf(char *s, const char *format, ...) {
// iconv const inconsistency workaround by Alexandre Oliva // iconv const inconsistency workaround by Alexandre Oliva
template <typename T> template <typename T>
inline size_t __iconv_adaptor inline size_t nsis_iconv_adaptor
(size_t (*iconv_func)(iconv_t, T, size_t *, char**,size_t*), (size_t (*iconv_func)(iconv_t, T, size_t *, char**,size_t*),
iconv_t cd, char **inbuf, size_t *inbytesleft, iconv_t cd, char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft) char **outbuf, size_t *outbytesleft)
@ -221,7 +222,7 @@ int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr,
size_t inbytes = cchWideChar * sizeof(WCHAR); size_t inbytes = cchWideChar * sizeof(WCHAR);
size_t outbytes = cbMultiByte; size_t outbytes = cbMultiByte;
if (__iconv_adaptor(iconv, cd, &in, &inbytes, &out, &outbytes) == (size_t) -1) { if (nsis_iconv_adaptor(iconv, cd, &in, &inbytes, &out, &outbytes) == (size_t) -1) {
iconv_close(cd); iconv_close(cd);
return 0; return 0;
} }
@ -257,7 +258,7 @@ int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr,
size_t inbytes = cbMultiByte; size_t inbytes = cbMultiByte;
size_t outbytes = cchWideChar * sizeof(WCHAR); size_t outbytes = cchWideChar * sizeof(WCHAR);
if (__iconv_adaptor(iconv, cd, &in, &inbytes, &out, &outbytes) == (size_t) -1) { if (nsis_iconv_adaptor(iconv, cd, &in, &inbytes, &out, &outbytes) == (size_t) -1) {
iconv_close(cd); iconv_close(cd);
return 0; return 0;
} }