瀏覽代碼

Merge topic 'update-kwsys'

6f3e094e Merge branch 'upstream-kwsys' into update-kwsys
d4d1b7f7 KWSys 2014-07-18 (65b36ede)
Brad King 11 年之前
父節點
當前提交
b86f0e445b
共有 3 個文件被更改,包括 22 次插入4 次删除
  1. 4 1
      Source/kwsys/SystemInformation.cxx
  2. 3 3
      Source/kwsys/Terminal.c
  3. 15 0
      Source/kwsys/testProcess.c

+ 4 - 1
Source/kwsys/SystemInformation.cxx

@@ -3696,7 +3696,10 @@ void SystemInformationImplementation::SetStackTraceOnError(int enable)
     // install ours
     struct sigaction sa;
     sa.sa_sigaction=(SigAction)StacktraceSignalHandler;
-    sa.sa_flags=SA_SIGINFO|SA_RESTART|SA_RESETHAND;
+    sa.sa_flags=SA_SIGINFO|SA_RESETHAND;
+# ifdef SA_RESTART
+    sa.sa_flags|=SA_RESTART;
+# endif
     sigemptyset(&sa.sa_mask);
 
     sigaction(SIGABRT,&sa,0);

+ 3 - 3
Source/kwsys/Terminal.c

@@ -104,11 +104,11 @@ void kwsysTerminal_cfprintf(int color, FILE* stream, const char* format, ...)
 }
 
 /*--------------------------------------------------------------------------*/
-/* Detect cases when a stream is definately not interactive.  */
+/* Detect cases when a stream is definitely not interactive.  */
 #if !defined(KWSYS_TERMINAL_ISATTY_WORKS)
 static int kwsysTerminalStreamIsNotInteractive(FILE* stream)
 {
-  /* The given stream is definately not interactive if it is a regular
+  /* The given stream is definitely not interactive if it is a regular
      file.  */
   struct stat stream_stat;
   if(fstat(fileno(stream), &stream_stat) == 0)
@@ -212,7 +212,7 @@ static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100,
   (void)default_tty;
   return isatty(fileno(stream))? 1:0;
 #else
-  /* Check for cases in which the stream is definately not a tty.  */
+  /* Check for cases in which the stream is definitely not a tty.  */
   if(kwsysTerminalStreamIsNotInteractive(stream))
     {
     return 0;

+ 15 - 0
Source/kwsys/testProcess.c

@@ -11,11 +11,13 @@
 ============================================================================*/
 #include "kwsysPrivate.h"
 #include KWSYS_HEADER(Process.h)
+#include KWSYS_HEADER(Encoding.h)
 
 /* Work-around CMake dependency scanning limitation.  This must
    duplicate the above list of headers.  */
 #if 0
 # include "Process.h.in"
+# include "Encoding.h.in"
 #endif
 
 #include <stdio.h>
@@ -393,6 +395,19 @@ int runChild(const char* cmd[], int state, int exception, int value,
 int main(int argc, const char* argv[])
 {
   int n = 0;
+
+#ifdef _WIN32
+  int i;
+  char new_args[10][_MAX_PATH];
+  LPWSTR* w_av = CommandLineToArgvW(GetCommandLineW(), &argc);
+  for(i=0; i<argc; i++)
+  {
+    kwsysEncoding_wcstombs(new_args[i], w_av[i], _MAX_PATH);
+    argv[i] = new_args[i];
+  }
+  LocalFree(w_av);
+#endif
+
 #if 0
     {
     HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);