summaryrefslogtreecommitdiff
path: root/navit/speech
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-05-05 13:13:27 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-05-05 13:13:27 +0000
commit0880a6b71006992acfcc8f7c53bea13700853443 (patch)
tree3750952eb798838e2cf6e71bc5c317873aa78689 /navit/speech
parent8cabb55c01ccd872b101b21e3c8578f26afa9a7c (diff)
downloadnavit-svn-0880a6b71006992acfcc8f7c53bea13700853443.tar.gz
Fix:speech_cmdline:Add support for win32/wince
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2252 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/speech')
-rw-r--r--navit/speech/cmdline/speech_cmdline.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/navit/speech/cmdline/speech_cmdline.c b/navit/speech/cmdline/speech_cmdline.c
index f401c867..ba8979ea 100644
--- a/navit/speech/cmdline/speech_cmdline.c
+++ b/navit/speech/cmdline/speech_cmdline.c
@@ -23,6 +23,10 @@
#include "item.h"
#include "plugin.h"
#include "speech.h"
+#ifdef HAVE_API_WIN32_BASE
+#include <windows.h>
+#include "util.h"
+#endif
#ifdef USE_EXEC
#include <sys/types.h>
#include <unistd.h>
@@ -64,11 +68,32 @@ speechd_say(struct speech_priv *this, const char *text)
}
return 0;
#else
+#ifdef HAVE_API_WIN32_BASE
+ char *cmdline,*p;
+ PROCESS_INFORMATION pr;
+ LPCWSTR cmd,arg;
+ int ret;
+
+
+ cmdline=g_strdup_printf(this->cmdline, text);
+ p=cmdline;
+ while (*p != ' ' && *p != '\0')
+ p++;
+ if (*p == ' ')
+ *p++='\0';
+ cmd = newSysString(cmdline);
+ arg = newSysString(p);
+ ret=!CreateProcess(cmd, arg, NULL, NULL, 0, CREATE_NEW_CONSOLE, NULL, NULL, NULL, &pr);
+ g_free(cmd);
+ g_free(arg);
+ return ret;
+#else
char *cmdline;
cmdline=g_strdup_printf(this->cmdline, text);
return system(cmdline);
#endif
+#endif
}
static void