Skip to content

Commit cdcb289

Browse files
author
ross
committed
[project @ 2004-05-06 17:26:14 by ross]
switch spawnProc to TSTR
1 parent 65c8e19 commit cdcb289

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

System/Win32/Process.hsc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ foreign import stdcall unsafe "windows.h Sleep"
4040

4141
#ifdef __GLASGOW_HASKELL__
4242
foreign import ccall unsafe "spawnProc.h"
43-
spawnProc :: CString -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO CInt
43+
spawnProc :: LPCTSTR -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO CInt
4444

4545
-- | Spawn a Win32 sub-process, to run the command given
4646
-- by the String, returning handles for the child's
@@ -51,7 +51,7 @@ spawn :: String
5151
, Handle -- read handle to child's stderr
5252
)
5353
spawn cmd =
54-
withCString cmd $ \ p_cmd ->
54+
withTString cmd $ \ p_cmd ->
5555
with 0 $ \ p_wIn ->
5656
with 0 $ \ p_rOut ->
5757
with 0 $ \ p_rErr -> do

cbits/spawnProc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <windows.h>
1010
#include <io.h>
1111
#include <fcntl.h>
12+
#include "spawnProc.h"
1213

1314
/*
1415
* Function: mkAnonPipe
@@ -76,7 +77,7 @@ mkAnonPipe( HANDLE* pHandleIn, BOOL isInheritableIn,
7677
}
7778

7879
int
79-
spawnProc ( char* cmd
80+
spawnProc ( LPTSTR cmd
8081
, int* pFdInWrite
8182
, int* pFdOutRead
8283
, int* pFdErrRead

include/spawnProc.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
extern int spawnProc(char* cmd, int* pFdInWrite, int* pFdOutRead, int* pFdErrRead);
1+
#ifndef __SPAWNPROC_H
2+
#define __SPAWNPROC_H
3+
4+
#include <windows.h>
5+
6+
extern int spawnProc(LPTSTR cmd, int* pFdInWrite, int* pFdOutRead, int* pFdErrRead);
7+
8+
#endif /* __SPAWNPROC_H */

0 commit comments

Comments
 (0)