Fossil SCM
Allow popen.c and winhttp.c to be compiled with -DUNICODE -D_UNICODE (the latter just by undefining those)
Commit
8bde948434b7c8eabe9ded22591b187c4ac5ffe7
Parent
65c8ca0571a3ea8…
2 files changed
+2
-2
+2
+2
-2
| --- src/popen.c | ||
| +++ src/popen.c | ||
| @@ -65,11 +65,11 @@ | ||
| 65 | 65 | ** and stderr channels for that process to use. |
| 66 | 66 | ** |
| 67 | 67 | ** Return the number of errors. |
| 68 | 68 | */ |
| 69 | 69 | 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 */ | |
| 71 | 71 | HANDLE hIn, /* Standard input */ |
| 72 | 72 | HANDLE hOut, /* Standard output */ |
| 73 | 73 | HANDLE hErr, /* Standard error */ |
| 74 | 74 | DWORD *pChildPid /* OUT: Child process handle */ |
| 75 | 75 | ){ |
| @@ -139,11 +139,11 @@ | ||
| 139 | 139 | if( !CreatePipe(&hStdinRd, &hStdinWr, &saAttr, 4096) ){ |
| 140 | 140 | win32_fatal_error("cannot create pipe for stdin"); |
| 141 | 141 | } |
| 142 | 142 | SetHandleInformation( hStdinWr, HANDLE_FLAG_INHERIT, FALSE); |
| 143 | 143 | |
| 144 | - win32_create_child_process((char*)zCmd, | |
| 144 | + win32_create_child_process(fossil_utf8_to_unicode(zCmd), | |
| 145 | 145 | hStdinRd, hStdoutWr, hStderr,&childPid); |
| 146 | 146 | *pChildPid = childPid; |
| 147 | 147 | *pfdIn = _open_osfhandle(PTR_TO_INT(hStdoutRd), 0); |
| 148 | 148 | fd = _open_osfhandle(PTR_TO_INT(hStdinWr), 0); |
| 149 | 149 | *ppOut = _fdopen(fd, "w"); |
| 150 | 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 | 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 |
+2
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -17,10 +17,12 @@ | ||
| 17 | 17 | ** |
| 18 | 18 | ** This file implements a very simple (and low-performance) HTTP server |
| 19 | 19 | ** for windows. It also implements a Windows Service which allows the HTTP |
| 20 | 20 | ** server to be run without any user logged on. |
| 21 | 21 | */ |
| 22 | +#undef UNICODE | |
| 23 | +#undef _UNICODE | |
| 22 | 24 | #include "config.h" |
| 23 | 25 | #ifdef _WIN32 |
| 24 | 26 | /* This code is for win32 only */ |
| 25 | 27 | #include <windows.h> |
| 26 | 28 | #include "winhttp.h" |
| 27 | 29 |
| --- 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 |