Merge branch 'upstream-kwsys' into update-kwsys

This commit is contained in:
Brad King 2015-01-10 12:09:04 -05:00
commit e5b9142097
5 changed files with 18 additions and 6 deletions

View File

@ -44,7 +44,7 @@ wchar_t* kwsysEncoding_DupToWide(const char* str)
size_t length = kwsysEncoding_mbstowcs(NULL, str, 0) + 1; size_t length = kwsysEncoding_mbstowcs(NULL, str, 0) + 1;
if(length > 0) if(length > 0)
{ {
ret = malloc((length)*sizeof(wchar_t)); ret = (wchar_t*)malloc((length)*sizeof(wchar_t));
ret[0] = 0; ret[0] = 0;
kwsysEncoding_mbstowcs(ret, str, length); kwsysEncoding_mbstowcs(ret, str, length);
} }
@ -71,7 +71,7 @@ char* kwsysEncoding_DupToNarrow(const wchar_t* str)
size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1; size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1;
if(length > 0) if(length > 0)
{ {
ret = malloc(length); ret = (char*)malloc(length);
ret[0] = 0; ret[0] = 0;
kwsysEncoding_wcstombs(ret, str, length); kwsysEncoding_wcstombs(ret, str, length);
} }

View File

@ -547,7 +547,7 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, const char* file)
} }
if(file) if(file)
{ {
*pfile = malloc(strlen(file)+1); *pfile = (char*)malloc(strlen(file)+1);
if(!*pfile) if(!*pfile)
{ {
return 0; return 0;
@ -1468,7 +1468,7 @@ static int kwsysProcessInitialize(kwsysProcess* cp)
cp->RealWorkingDirectoryLength = 4096; cp->RealWorkingDirectoryLength = 4096;
#endif #endif
cp->RealWorkingDirectory = cp->RealWorkingDirectory =
malloc((size_t)(cp->RealWorkingDirectoryLength)); (char*)malloc((size_t)(cp->RealWorkingDirectoryLength));
if(!cp->RealWorkingDirectory) if(!cp->RealWorkingDirectory)
{ {
return 0; return 0;

View File

@ -16,6 +16,14 @@
# define _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED
#endif #endif
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
# define KWSYS_WINDOWS_DIRS
#else
# if defined(__SUNPRO_CC)
# include <fcntl.h>
# endif
#endif
#include "kwsysPrivate.h" #include "kwsysPrivate.h"
#include KWSYS_HEADER(RegularExpression.hxx) #include KWSYS_HEADER(RegularExpression.hxx)
#include KWSYS_HEADER(SystemTools.hxx) #include KWSYS_HEADER(SystemTools.hxx)
@ -205,8 +213,7 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft)
} }
#endif #endif
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)) #ifdef KWSYS_WINDOWS_DIRS
#include <wctype.h> #include <wctype.h>
inline int Mkdir(const kwsys_stl::string& dir) inline int Mkdir(const kwsys_stl::string& dir)

View File

@ -175,6 +175,7 @@ static const char* kwsysTerminalVT100Names[] =
"xterm-88color", "xterm-88color",
"xterm-color", "xterm-color",
"xterm-debian", "xterm-debian",
"xterm-termite",
0 0
}; };

View File

@ -548,6 +548,10 @@ int main()
#if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
# define _GNU_SOURCE # define _GNU_SOURCE
#endif #endif
#if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 \
&& __linux && __SUNPRO_CC_COMPAT == 'G'
# include <iostream>
#endif
#include <cxxabi.h> #include <cxxabi.h>
int main() int main()
{ {