Fossil SCM

Allow popen.c and winhttp.c to be compiled with -DUNICODE -D_UNICODE (the latter just by undefining those)

jan.nijtmans 2012-08-22 14:53 eclipse-project
Commit 8bde948434b7c8eabe9ded22591b187c4ac5ffe7
2 files changed +2 -2 +2
+2 -2
--- src/popen.c
+++ src/popen.c
@@ -65,11 +65,11 @@
6565
** and stderr channels for that process to use.
6666
**
6767
** Return the number of errors.
6868
*/
6969
static int win32_create_child_process(
70
- char *zCmd, /* The command that the child process will run */
70
+ TCHAR *zCmd, /* The command that the child process will run */
7171
HANDLE hIn, /* Standard input */
7272
HANDLE hOut, /* Standard output */
7373
HANDLE hErr, /* Standard error */
7474
DWORD *pChildPid /* OUT: Child process handle */
7575
){
@@ -139,11 +139,11 @@
139139
if( !CreatePipe(&hStdinRd, &hStdinWr, &saAttr, 4096) ){
140140
win32_fatal_error("cannot create pipe for stdin");
141141
}
142142
SetHandleInformation( hStdinWr, HANDLE_FLAG_INHERIT, FALSE);
143143
144
- win32_create_child_process((char*)zCmd,
144
+ win32_create_child_process(fossil_utf8_to_unicode(zCmd),
145145
hStdinRd, hStdoutWr, hStderr,&childPid);
146146
*pChildPid = childPid;
147147
*pfdIn = _open_osfhandle(PTR_TO_INT(hStdoutRd), 0);
148148
fd = _open_osfhandle(PTR_TO_INT(hStdinWr), 0);
149149
*ppOut = _fdopen(fd, "w");
150150
--- src/popen.c
+++ src/popen.c
@@ -65,11 +65,11 @@
65 ** and stderr channels for that process to use.
66 **
67 ** Return the number of errors.
68 */
69 static int win32_create_child_process(
70 char *zCmd, /* The command that the child process will run */
71 HANDLE hIn, /* Standard input */
72 HANDLE hOut, /* Standard output */
73 HANDLE hErr, /* Standard error */
74 DWORD *pChildPid /* OUT: Child process handle */
75 ){
@@ -139,11 +139,11 @@
139 if( !CreatePipe(&hStdinRd, &hStdinWr, &saAttr, 4096) ){
140 win32_fatal_error("cannot create pipe for stdin");
141 }
142 SetHandleInformation( hStdinWr, HANDLE_FLAG_INHERIT, FALSE);
143
144 win32_create_child_process((char*)zCmd,
145 hStdinRd, hStdoutWr, hStderr,&childPid);
146 *pChildPid = childPid;
147 *pfdIn = _open_osfhandle(PTR_TO_INT(hStdoutRd), 0);
148 fd = _open_osfhandle(PTR_TO_INT(hStdinWr), 0);
149 *ppOut = _fdopen(fd, "w");
150
--- src/popen.c
+++ src/popen.c
@@ -65,11 +65,11 @@
65 ** and stderr channels for that process to use.
66 **
67 ** Return the number of errors.
68 */
69 static int win32_create_child_process(
70 TCHAR *zCmd, /* The command that the child process will run */
71 HANDLE hIn, /* Standard input */
72 HANDLE hOut, /* Standard output */
73 HANDLE hErr, /* Standard error */
74 DWORD *pChildPid /* OUT: Child process handle */
75 ){
@@ -139,11 +139,11 @@
139 if( !CreatePipe(&hStdinRd, &hStdinWr, &saAttr, 4096) ){
140 win32_fatal_error("cannot create pipe for stdin");
141 }
142 SetHandleInformation( hStdinWr, HANDLE_FLAG_INHERIT, FALSE);
143
144 win32_create_child_process(fossil_utf8_to_unicode(zCmd),
145 hStdinRd, hStdoutWr, hStderr,&childPid);
146 *pChildPid = childPid;
147 *pfdIn = _open_osfhandle(PTR_TO_INT(hStdoutRd), 0);
148 fd = _open_osfhandle(PTR_TO_INT(hStdinWr), 0);
149 *ppOut = _fdopen(fd, "w");
150
--- src/winhttp.c
+++ src/winhttp.c
@@ -17,10 +17,12 @@
1717
**
1818
** This file implements a very simple (and low-performance) HTTP server
1919
** for windows. It also implements a Windows Service which allows the HTTP
2020
** server to be run without any user logged on.
2121
*/
22
+#undef UNICODE
23
+#undef _UNICODE
2224
#include "config.h"
2325
#ifdef _WIN32
2426
/* This code is for win32 only */
2527
#include <windows.h>
2628
#include "winhttp.h"
2729
--- src/winhttp.c
+++ src/winhttp.c
@@ -17,10 +17,12 @@
17 **
18 ** This file implements a very simple (and low-performance) HTTP server
19 ** for windows. It also implements a Windows Service which allows the HTTP
20 ** server to be run without any user logged on.
21 */
 
 
22 #include "config.h"
23 #ifdef _WIN32
24 /* This code is for win32 only */
25 #include <windows.h>
26 #include "winhttp.h"
27
--- src/winhttp.c
+++ src/winhttp.c
@@ -17,10 +17,12 @@
17 **
18 ** This file implements a very simple (and low-performance) HTTP server
19 ** for windows. It also implements a Windows Service which allows the HTTP
20 ** server to be run without any user logged on.
21 */
22 #undef UNICODE
23 #undef _UNICODE
24 #include "config.h"
25 #ifdef _WIN32
26 /* This code is for win32 only */
27 #include <windows.h>
28 #include "winhttp.h"
29

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button